Class DependencyManager.SingleDynamicCustomizer

java.lang.Object
DependencyManager<S,T>.org.apache.felix.scr.impl.manager.DependencyManager.AbstractCustomizer
org.apache.felix.scr.impl.manager.DependencyManager.SingleDynamicCustomizer
All Implemented Interfaces:
DependencyManager.Customizer<S,T>, ServiceTrackerCustomizer<T,RefPair<S,T>,ExtendedServiceEvent>
Enclosing class:
DependencyManager<S,T>

private class DependencyManager.SingleDynamicCustomizer extends DependencyManager<S,T>.AbstractCustomizer
  • Field Details

    • currentRefPair

      private RefPair<S,T> currentRefPair
    • bindingRefPair

      private RefPair<S,T> bindingRefPair
    • queuedRefPairs

      private Collection<RefPair<S,T>> queuedRefPairs
    • bindingThread

      private Thread bindingThread
    • trackingCount

      private int trackingCount
  • Constructor Details

    • SingleDynamicCustomizer

      private SingleDynamicCustomizer()
  • Method Details

    • addingService

      public RefPair<S,T> addingService(org.osgi.framework.ServiceReference<T> serviceReference)
      Description copied from interface: ServiceTrackerCustomizer
      A service is being added to the ServiceTracker.

      This method is called before a service which matched the search parameters of the ServiceTracker is added to the ServiceTracker. This method should return the service object to be tracked for the specified ServiceReference. The returned service object is stored in the ServiceTracker and is available from the getService and getServices methods.

      Parameters:
      serviceReference - The reference to the service being added to the ServiceTracker.
      Returns:
      The service object to be tracked for the specified referenced service or null if the specified referenced service should not be tracked.
    • addedService

      public void addedService(org.osgi.framework.ServiceReference<T> serviceReference, RefPair<S,T> refPair, int trackingCount, int serviceCount, ExtendedServiceEvent event)
    • tryInvokeBind

      private void tryInvokeBind(ServiceTracker<T,RefPair<S,T>,ExtendedServiceEvent> tracker, Object monitor, RefPair<S,T> next, int trackingCount)
    • getBestFromQueue

      private RefPair<S,T> getBestFromQueue()
    • tryInvokeBind0

      private RefPair<S,T> tryInvokeBind0(ServiceTracker<T,RefPair<S,T>,ExtendedServiceEvent> tracker, Object monitor, RefPair<S,T> refPair, int trackingCount)
    • modifiedService

      public void modifiedService(org.osgi.framework.ServiceReference<T> serviceReference, RefPair<S,T> refPair, int trackingCount, ExtendedServiceEvent event)
      Description copied from interface: ServiceTrackerCustomizer
      A service tracked by the ServiceTracker has been modified.

      This method is called when a service being tracked by the ServiceTracker has had it properties modified.

      Parameters:
      serviceReference - The reference to the service that has been modified.
      refPair - The service object for the specified referenced service.
      trackingCount -
      event - TODO
    • removedService

      public void removedService(org.osgi.framework.ServiceReference<T> serviceReference, RefPair<S,T> refPair, int trackingCount, ExtendedServiceEvent event)
      Description copied from interface: ServiceTrackerCustomizer
      A service tracked by the ServiceTracker has been removed.

      This method is called after a service is no longer being tracked by the ServiceTracker.

      Parameters:
      serviceReference - The reference to the service that has been removed.
      refPair - The service object for the specified referenced service.
      trackingCount -
      event - TODO
    • prebind

      public boolean prebind(ComponentContextImpl<S> key)
      Description copied from interface: DependencyManager.Customizer
      attempt to obtain the services from the tracked service references that will be used in inital bind calls before activation.
      Parameters:
      key - TODO
      Returns:
      true if there are enough services for activation.
    • close

      public void close()
    • closeRefPair

      private void closeRefPair()
    • getRefs

      public Collection<RefPair<S,T>> getRefs(AtomicInteger trackingCount)