Class ServiceObjectTracker<T>

  • Type Parameters:
    T - The type to track

    public class ServiceObjectTracker<T>
    extends java.lang.Object
    Helper class to track ServiceObjects and the services retrieved from them.
    Since:
    1.18
    • Constructor Summary

      Constructors 
      Constructor Description
      ServiceObjectTracker​(org.osgi.framework.BundleContext bundleContext, java.lang.Class<T> clazz)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dispose()
      Disposes this services which leads to ungetting all retrieved services.
      T getService()
      Retrieves the Service.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ServiceObjectTracker

        public ServiceObjectTracker​(org.osgi.framework.BundleContext bundleContext,
                                    java.lang.Class<T> clazz)
        Constructor.
        Parameters:
        bundleContext - The BundleContext to use
        clazz - The Class of the service to retrieve
    • Method Detail

      • getService

        public T getService()
        Retrieves the Service.
        Returns:
        The Service or null
        See Also:
        ServiceObjects.getService()
      • dispose

        public void dispose()
        Disposes this services which leads to ungetting all retrieved services.
        See Also:
        ServiceObjects.ungetService(Object)