public class ServiceUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static <T> T |
getService(org.osgi.framework.BundleContext bundleContext,
java.lang.Class<T> serviceClass)
Gets an OSGi service registered in a specific BundleContext by
its Class
|
static <T> java.util.Collection<org.osgi.framework.ServiceReference<T>> |
getServiceReferences(org.osgi.framework.BundleContext bundleContext,
java.lang.Class<T> serviceClass)
Gets an OSGi service references registered in a specific
BundleContext by its Class.
|
public static <T> T getService(org.osgi.framework.BundleContext bundleContext, java.lang.Class<T> serviceClass)
T
- the very type of the OSGi service to getbundleContext
- the BundleContext in which the service to
get has been registeredserviceClass
- the Class with which the service to get has
been registered in the bundleContextpublic static <T> java.util.Collection<org.osgi.framework.ServiceReference<T>> getServiceReferences(org.osgi.framework.BundleContext bundleContext, java.lang.Class<T> serviceClass)
bundleContext
- the BundleContext in which the services to
get have been registeredserviceClass
- the Class of the OSGi service references to
get
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.