Java Code Examples for org.wso2.carbon.ui.CarbonUIUtil#getBundleContext()
The following examples show how to use
org.wso2.carbon.ui.CarbonUIUtil#getBundleContext() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Util.java From carbon-commons with Apache License 2.0 | 6 votes |
public static String getRelativeUrl() { BundleContext context = CarbonUIUtil.getBundleContext(); ServiceReference reference = context.getServiceReference(RegistryService.class .getName()); RegistryService registryService = (RegistryService) context.getService(reference); String url = null; try { Registry systemRegistry = registryService.getConfigSystemRegistry(); Resource resource = systemRegistry.get("/carbon/connection/props"); String servicePath = resource.getProperty("service-path"); String contextRoot = resource.getProperty("context-root"); contextRoot = contextRoot.equals("/") ? "" : contextRoot; url = contextRoot + servicePath + "/Java2WSDLService"; } catch (Exception e) { log.error(e); } return url; }
Example 2
Source File: Util.java From carbon-commons with Apache License 2.0 | 6 votes |
public static String getRelativeUrl() { BundleContext context = CarbonUIUtil.getBundleContext(); ServiceReference reference = context.getServiceReference(RegistryService.class.getName()); RegistryService registryService = (RegistryService) context.getService(reference); String url = null; try { Registry systemRegistry = registryService.getConfigSystemRegistry(); Resource resource = systemRegistry.get(RegistryResources.CONNECTION_PROPS); String servicePath = resource.getProperty("service-path"); String contextRoot = resource.getProperty("context-root"); contextRoot = contextRoot.equals("/") ? "" : contextRoot; url = contextRoot + servicePath + "/WSDL2CodeService"; } catch (Exception e) { log.error(e); } return url; }
Example 3
Source File: Util.java From carbon-commons with Apache License 2.0 | 6 votes |
public static String getRelativeUrl() { BundleContext context = CarbonUIUtil.getBundleContext(); ServiceReference reference = context.getServiceReference(RegistryService.class.getName()); RegistryService registryService = (RegistryService) context.getService(reference); String url = null; try { Registry systemRegistry = registryService.getConfigSystemRegistry(); Resource resource = systemRegistry.get(RegistryResources.CONNECTION_PROPS); String servicePath = resource.getProperty("service-path"); String contextRoot = resource.getProperty("context-root"); contextRoot = contextRoot.equals("/") ? "" : contextRoot; url = contextRoot + servicePath + "/WSDL2CodeService"; } catch (Exception e) { log.error(e); } return url; }
Example 4
Source File: UIAnnouncementDeployer.java From attic-stratos with Apache License 2.0 | 4 votes |
public static void deployNotificationSources() { BundleContext bundleContext = CarbonUIUtil.getBundleContext(); uiAnnouncementTracker = new ServiceTracker(bundleContext, UIAnnouncement.class.getName(), null); uiAnnouncementTracker.open(); }