|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.osgi.framework.internal.core.ServiceRegistryImpl
public class ServiceRegistryImpl
A default implementation of the ServiceRegistry.
Field Summary | |
---|---|
protected java.util.ArrayList |
allPublishedServices
All published services. |
protected java.util.HashMap |
publishedServicesByClass
Published services by class name. |
protected java.util.HashMap |
publishedServicesByContext
Published services by BundleContext. |
Constructor Summary | |
---|---|
ServiceRegistryImpl()
|
Method Summary | |
---|---|
void |
initialize()
Initializes the internal data structures of this ServiceRegistry. |
ServiceReference[] |
lookupServiceReferences(BundleContext context)
Performs a lookup for ServiceReferences that are bound to this ServiceRegistry using the specified BundleContext. |
ServiceReference[] |
lookupServiceReferences(java.lang.String clazz,
Filter filter)
Performs a lookup for ServiceReferences that are bound to this ServiceRegistry. |
void |
publishService(BundleContext context,
ServiceRegistration serviceReg)
Publishes a service to this ServiceRegistry. |
void |
unpublishService(BundleContext context,
ServiceRegistration serviceReg)
Unpublishes a service from this ServiceRegistry |
void |
unpublishServices(BundleContext context)
Unpublishes all services from this ServiceRegistry that the specified BundleContext registered. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.HashMap publishedServicesByClass
protected java.util.ArrayList allPublishedServices
protected java.util.HashMap publishedServicesByContext
Constructor Detail |
---|
public ServiceRegistryImpl()
Method Detail |
---|
public void initialize()
public void publishService(BundleContext context, ServiceRegistration serviceReg)
ServiceRegistry
publishService
in interface ServiceRegistry
context
- the BundleContext that registered the service.serviceReg
- the ServiceRegistration to register.ServiceRegistry.publishService(BundleContext, ServiceRegistration)
public void unpublishService(BundleContext context, ServiceRegistration serviceReg)
ServiceRegistry
unpublishService
in interface ServiceRegistry
context
- the BundleContext that registered the service.serviceReg
- the ServiceRegistration to unpublish.ServiceRegistry.unpublishService(BundleContext, ServiceRegistration)
public void unpublishServices(BundleContext context)
ServiceRegistry
unpublishServices
in interface ServiceRegistry
context
- the BundleContext to unpublish all services for.ServiceRegistry.unpublishServices(BundleContext)
public ServiceReference[] lookupServiceReferences(java.lang.String clazz, Filter filter)
ServiceRegistry
lookupServiceReferences
in interface ServiceRegistry
clazz
- A fully qualified class name. All ServiceReferences that
reference an object that implement this class are returned. May be
null.filter
- Used to match against published Services. All
ServiceReferences that match the filter are returned. If a clazz is
specified then all ServiceReferences that match the clazz and the
filter parameter are returned. May be null.
ServiceRegistry.lookupServiceReferences(String, Filter)
public ServiceReference[] lookupServiceReferences(BundleContext context)
ServiceRegistry
lookupServiceReferences
in interface ServiceRegistry
context
- The BundleContext to lookup the ServiceReferences on.
ServiceRegistry.lookupServiceReferences(BundleContext)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |