public class ServiceObserver<T>
extends java.lang.Object
implements org.osgi.framework.ServiceListener
Constructor and Description |
---|
ServiceObserver(java.lang.Class<T> clazz)
Creates new instance of ServiceObserver that will observe
services of given className.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<T> |
getServices()
Returns list of services compatible with service class observed by
this instance.
|
void |
serviceChanged(org.osgi.framework.ServiceEvent serviceEvent) |
void |
start(org.osgi.framework.BundleContext ctx)
This method must be called when OSGi i s starting to initialize the
observer.
|
void |
stop(org.osgi.framework.BundleContext ctx)
This method should be called on bundle shutdown to properly release
the resources.
|
public ServiceObserver(java.lang.Class<T> clazz)
clazz
- the Class of the service to observe.public java.util.List<T> getServices()
public void serviceChanged(org.osgi.framework.ServiceEvent serviceEvent)
serviceChanged
in interface org.osgi.framework.ServiceListener
public void start(org.osgi.framework.BundleContext ctx)
ctx
- the OSGi bundle context.public void stop(org.osgi.framework.BundleContext ctx)
ctx
- OSGi context
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.