public class ServiceRegistry extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
ServiceRegistry.ServiceRegistryCallbacks |
Constructor and Description |
---|
ServiceRegistry(Logger logger,
ServiceRegistry.ServiceRegistryCallbacks callbacks) |
Modifier and Type | Method and Description |
---|---|
<S> Set<ServiceReference<S>> |
getHooks(Class<S> hookClass) |
Logger |
getLogger() |
ServiceReference<?>[] |
getRegisteredServices(Bundle bundle) |
<S> S |
getService(Bundle bundle,
ServiceReference<S> ref,
boolean isServiceObjects) |
Collection |
getServiceReferences(String className,
SimpleFilter filter) |
ServiceReference<?>[] |
getServicesInUse(Bundle bundle) |
Bundle[] |
getUsingBundles(ServiceReference<?> ref) |
ServiceRegistration<?> |
registerService(BundleContext context,
String[] classNames,
Object svcObj,
Dictionary dict) |
boolean |
ungetService(Bundle bundle,
ServiceReference<?> ref,
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.
|
public ServiceRegistry(Logger logger, ServiceRegistry.ServiceRegistryCallbacks callbacks)
public ServiceReference<?>[] getRegisteredServices(Bundle bundle)
public ServiceRegistration<?> registerService(BundleContext context, String[] classNames, Object svcObj, Dictionary dict)
public void unregisterService(Bundle bundle, ServiceRegistration<?> reg)
public void unregisterServices(Bundle bundle)
bundle
- the bundle whose services should be unregistered.public Collection getServiceReferences(String className, SimpleFilter filter)
public ServiceReference<?>[] getServicesInUse(Bundle bundle)
public <S> S getService(Bundle bundle, ServiceReference<S> ref, boolean isServiceObjects)
public boolean ungetService(Bundle bundle, ServiceReference<?> ref, Object svcObj)
public void ungetServices(Bundle bundle)
bundle
- the bundle whose services are to be released.public Bundle[] getUsingBundles(ServiceReference<?> ref)
public Logger getLogger()
public <S> Set<ServiceReference<S>> getHooks(Class<S> hookClass)
Copyright © 2016. All rights reserved.