public class OsgiServiceRegistry extends Object
Constructor and Description |
---|
OsgiServiceRegistry()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Set<OsgiService> |
getServices(ComponentContainer componentContainer)
Returns the services defined by the previously registered interfaces and factories.
|
boolean |
isTrackBundleEnabled(Class<?> iface) |
void |
registerService(Class<?> serviceInterface)
Registers the intent to publish an implementation of the given interface, if one exists.
|
void |
registerService(Class<?> serviceInterface,
boolean trackBundle)
Registers the intent to publish an implementation of the given interface, if one exists.
|
<T> void |
registerServiceFactory(Class<? super T> serviceInterface,
Class<? extends org.osgi.framework.ServiceFactory<T>> osgiFactoryClass)
Registers the intent to publish the given service as one that comes from an OSGi
ServiceFactory rather than being a singleton instance. |
public void registerService(Class<?> serviceInterface)
serviceInterface
- the type of service to publishpublic void registerService(Class<?> serviceInterface, boolean trackBundle)
serviceInterface
- the type of service to publishtrackBundle
- whether service should be trackedpublic boolean isTrackBundleEnabled(Class<?> iface)
public <T> void registerServiceFactory(Class<? super T> serviceInterface, Class<? extends org.osgi.framework.ServiceFactory<T>> osgiFactoryClass)
ServiceFactory
rather than being a singleton instance.T
- the service typeserviceInterface
- the interface of the serviceosgiFactoryClass
- the type of factory that creates instances of the service@Nonnull public Set<OsgiService> getServices(ComponentContainer componentContainer)
componentContainer
- contains any singleton instances of the registered servicesCopyright © 2002-2022 Atlassian. All Rights Reserved.