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 |
---|---|
HookRegistry |
getHookRegistry() |
Logger |
getLogger() |
ServiceReference<?>[] |
getRegisteredServices(Bundle bundle)
Get all service references for a bundle
|
<S> S |
getService(Bundle bundle,
ServiceReference<S> ref,
boolean isServiceObjects) |
Collection<Capability> |
getServiceReferences(String className,
SimpleFilter filter) |
ServiceReference<?>[] |
getServicesInUse(Bundle bundle) |
Bundle[] |
getUsingBundles(ServiceReference<?> ref) |
ServiceRegistration<?> |
registerService(Bundle bundle,
String[] classNames,
Object svcObj,
Dictionary<?,?> dict)
Register a new service
Caller must fire service event as this method is not doing it!
|
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)
Unregister a service
|
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)
bundle
- null
.public ServiceRegistration<?> registerService(Bundle bundle, String[] classNames, Object svcObj, Dictionary<?,?> dict)
bundle
- The bundle registering the serviceclassNames
- The service class namessvcObj
- The service objectdict
- Optional service propertiespublic void unregisterService(Bundle bundle, ServiceRegistration<?> reg)
bundle
- The bundle unregistering the servicereg
- The service registrationpublic void unregisterServices(Bundle bundle)
bundle
- the bundle whose services should be unregistered.public Collection<Capability> 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 HookRegistry getHookRegistry()
Copyright © 2006–2016 The Apache Software Foundation. All rights reserved.