org.apache.felix.framework
Class ServiceRegistry
java.lang.Object
org.apache.felix.framework.ServiceRegistry
public class ServiceRegistry
- extends java.lang.Object
Method Summary |
void |
addServiceListener(org.osgi.framework.ServiceListener l)
|
protected void |
fireServiceChanged(org.osgi.framework.ServiceEvent event)
|
Logger |
getLogger()
|
org.osgi.framework.ServiceReference[] |
getRegisteredServices(org.osgi.framework.Bundle bundle)
|
java.lang.Object |
getService(org.osgi.framework.Bundle bundle,
org.osgi.framework.ServiceReference ref)
|
java.util.List |
getServiceReferences(java.lang.String className,
org.osgi.framework.Filter filter)
|
org.osgi.framework.ServiceReference[] |
getServicesInUse(org.osgi.framework.Bundle bundle)
|
org.osgi.framework.Bundle[] |
getUsingBundles(org.osgi.framework.ServiceReference ref)
|
org.osgi.framework.ServiceRegistration |
registerService(org.osgi.framework.Bundle bundle,
java.lang.String[] classNames,
java.lang.Object svcObj,
java.util.Dictionary dict)
|
void |
removeServiceListener(org.osgi.framework.ServiceListener l)
|
void |
servicePropertiesModified(org.osgi.framework.ServiceRegistration reg)
|
boolean |
ungetService(org.osgi.framework.Bundle bundle,
org.osgi.framework.ServiceReference ref)
|
void |
ungetServices(org.osgi.framework.Bundle bundle)
This is a utility method to release all services being
used by the specified bundle. |
void |
unregisterService(org.osgi.framework.Bundle bundle,
org.osgi.framework.ServiceRegistration reg)
|
void |
unregisterServices(org.osgi.framework.Bundle bundle)
This method retrieves all services registrations for the specified
bundle and invokes ServiceRegistration.unregister() on each
one. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ServiceRegistry
public ServiceRegistry(Logger logger)
getRegisteredServices
public org.osgi.framework.ServiceReference[] getRegisteredServices(org.osgi.framework.Bundle bundle)
registerService
public org.osgi.framework.ServiceRegistration registerService(org.osgi.framework.Bundle bundle,
java.lang.String[] classNames,
java.lang.Object svcObj,
java.util.Dictionary dict)
unregisterService
public void unregisterService(org.osgi.framework.Bundle bundle,
org.osgi.framework.ServiceRegistration reg)
unregisterServices
public void unregisterServices(org.osgi.framework.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.List getServiceReferences(java.lang.String className,
org.osgi.framework.Filter filter)
getServicesInUse
public org.osgi.framework.ServiceReference[] getServicesInUse(org.osgi.framework.Bundle bundle)
getService
public java.lang.Object getService(org.osgi.framework.Bundle bundle,
org.osgi.framework.ServiceReference ref)
ungetService
public boolean ungetService(org.osgi.framework.Bundle bundle,
org.osgi.framework.ServiceReference ref)
ungetServices
public void ungetServices(org.osgi.framework.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 org.osgi.framework.Bundle[] getUsingBundles(org.osgi.framework.ServiceReference ref)
servicePropertiesModified
public void servicePropertiesModified(org.osgi.framework.ServiceRegistration reg)
getLogger
public Logger getLogger()
addServiceListener
public void addServiceListener(org.osgi.framework.ServiceListener l)
removeServiceListener
public void removeServiceListener(org.osgi.framework.ServiceListener l)
fireServiceChanged
protected void fireServiceChanged(org.osgi.framework.ServiceEvent event)