Package org.apache.felix.framework
Class ServiceRegistry
- java.lang.Object
-
- org.apache.felix.framework.ServiceRegistry
-
public class ServiceRegistry extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ServiceRegistry.ServiceRegistryCallbacks
-
Constructor Summary
Constructors Constructor Description ServiceRegistry(Logger logger, ServiceRegistry.ServiceRegistryCallbacks callbacks)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <S> java.util.Set<ServiceReference<S>>
getHooks(java.lang.Class<S> hookClass)
Logger
getLogger()
ServiceReference<?>[]
getRegisteredServices(Bundle bundle)
<S> S
getService(Bundle bundle, ServiceReference<S> ref, boolean isServiceObjects)
java.util.Collection
getServiceReferences(java.lang.String className, SimpleFilter filter)
ServiceReference<?>[]
getServicesInUse(Bundle bundle)
Bundle[]
getUsingBundles(ServiceReference<?> ref)
ServiceRegistration<?>
registerService(BundleContext context, java.lang.String[] classNames, java.lang.Object svcObj, java.util.Dictionary dict)
boolean
ungetService(Bundle bundle, ServiceReference<?> ref, java.lang.Object svcObj)
void
ungetServices(Bundle bundle)
This is a utility method to release all services being used by the specified bundle.void
unregisterService(Bundle bundle, ServiceRegistration<?> reg)
void
unregisterServices(Bundle bundle)
This method retrieves all services registrations for the specified bundle and invokes ServiceRegistration.unregister() on each one.
-
-
-
Constructor Detail
-
ServiceRegistry
public ServiceRegistry(Logger logger, ServiceRegistry.ServiceRegistryCallbacks callbacks)
-
-
Method Detail
-
getRegisteredServices
public ServiceReference<?>[] getRegisteredServices(Bundle bundle)
-
registerService
public ServiceRegistration<?> registerService(BundleContext context, java.lang.String[] classNames, java.lang.Object svcObj, java.util.Dictionary dict)
-
unregisterService
public void unregisterService(Bundle bundle, ServiceRegistration<?> reg)
-
unregisterServices
public void unregisterServices(Bundle bundle)
This method retrieves all services registrations for the specified bundle and invokes ServiceRegistration.unregister() on each one. This method is only called be the framework to clean up after a stopped bundle.- Parameters:
bundle
- the bundle whose services should be unregistered.
-
getServiceReferences
public java.util.Collection getServiceReferences(java.lang.String className, SimpleFilter filter)
-
getServicesInUse
public ServiceReference<?>[] getServicesInUse(Bundle bundle)
-
getService
public <S> S getService(Bundle bundle, ServiceReference<S> ref, boolean isServiceObjects)
-
ungetService
public boolean ungetService(Bundle bundle, ServiceReference<?> ref, java.lang.Object svcObj)
-
ungetServices
public void ungetServices(Bundle bundle)
This is a utility method to release all services being used by the specified bundle.- Parameters:
bundle
- the bundle whose services are to be released.
-
getUsingBundles
public Bundle[] getUsingBundles(ServiceReference<?> ref)
-
getLogger
public Logger getLogger()
-
getHooks
public <S> java.util.Set<ServiceReference<S>> getHooks(java.lang.Class<S> hookClass)
-
-