org.robokind.api.common.osgi
Class ServiceClassListener<T>

java.lang.Object
  extended by org.robokind.api.common.property.PropertyChangeNotifier
      extended by org.robokind.api.common.osgi.ServiceClassListener<T>
All Implemented Interfaces:
EventListener, org.osgi.framework.ServiceListener, PropertyChangeSource

public class ServiceClassListener<T>
extends PropertyChangeNotifier
implements org.osgi.framework.ServiceListener

Author:
Matthew Stevenson

Field Summary
static String PROP_SERVICE_ADDED
          Fired when a new service is available
static String PROP_SERVICE_REMOVED
          Fired when a service is no longer available
 
Constructor Summary
ServiceClassListener(Class<T> clazz, org.osgi.framework.BundleContext context, String serviceFilter)
           
 
Method Summary
protected  void addService(T t)
           
 List<org.osgi.framework.ServiceReference> getServiceReferences()
           
 T getTopService()
           
protected  void removeService(T t)
           
 void serviceChanged(org.osgi.framework.ServiceEvent se)
           
 void start()
           
 void stop()
           
 
Methods inherited from class org.robokind.api.common.property.PropertyChangeNotifier
addPropertyChangeListener, addPropertyChangeListener, clearAllListeners, clearListeners, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, hasListeners, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_SERVICE_ADDED

public static final String PROP_SERVICE_ADDED
Fired when a new service is available

See Also:
Constant Field Values

PROP_SERVICE_REMOVED

public static final String PROP_SERVICE_REMOVED
Fired when a service is no longer available

See Also:
Constant Field Values
Constructor Detail

ServiceClassListener

public ServiceClassListener(Class<T> clazz,
                            org.osgi.framework.BundleContext context,
                            String serviceFilter)
Parameters:
context -
list -
Method Detail

start

public void start()

stop

public void stop()

serviceChanged

public void serviceChanged(org.osgi.framework.ServiceEvent se)
Specified by:
serviceChanged in interface org.osgi.framework.ServiceListener

addService

protected void addService(T t)

removeService

protected void removeService(T t)

getServiceReferences

public List<org.osgi.framework.ServiceReference> getServiceReferences()

getTopService

public T getTopService()


Copyright © 2011-2013. All Rights Reserved.