Designing and Implementing Composite Applications : Getting Started with the webMethods Application Platform API : Using the Application Platform API : Looking up Services from the OSGi Registry
Looking up Services from the OSGi Registry
 
Configuring POJO Services Dynamically
Class and Description
com.softwareag.applatform.sdk.ServiceUtil
A helper class that provides utility methods when working with OSGi services. Use this class to look up registered services.
Public API Methods in ServiceUtil Class
The following table lists the public API methods in ServiceUtil class:
Method Name
Return Type
Method Arguments
Description
getService
T
ServletContext servletCtxClass<T> serviceCls
Returns the instance of the OSGi service of type serviceCls from the specified ServletContext. This method looks for an instance of BundleContext in the ServletContext under the attribute name osgi-bundlecontext and use the obtained BundleContext to look up the service.
getService
T
Class<T> serviceClsBundleContext bundleCtx
Gets the OSGi service of given serviceCls type using the given BundleContext. If no service of the serviceCls type is registered, this method returns a null value.
getBundleContext
BundleContext
Class<?> bundleCls
Gets the BundleContext from the bundle containing the given class. If there is no BundleContext specified, this method returns a null value.
getService
T
Class<T> serviceCls
Gets the OSGi service for the given service class type. If no service of the specified type is registered, this method returns a null value.
Copyright © 2017 Software AG, Darmstadt, Germany. (Innovation Release)

Product LogoContact Support   |   Community   |   Feedback