org.apache.felix.http.proxy
Class DispatcherTracker

java.lang.Object
  extended by org.osgi.util.tracker.ServiceTracker
      extended by org.apache.felix.http.proxy.DispatcherTracker
All Implemented Interfaces:
ServiceTrackerCustomizer

public final class DispatcherTracker
extends ServiceTracker


Field Summary
 
Fields inherited from class org.osgi.util.tracker.ServiceTracker
context, filter
 
Constructor Summary
DispatcherTracker(BundleContext context, String filter, ServletConfig config)
           
 
Method Summary
 Object addingService(ServiceReference ref)
          Default implementation of the ServiceTrackerCustomizer.addingService method.
 HttpServlet getDispatcher()
           
 void removedService(ServiceReference ref, Object service)
          Default implementation of the ServiceTrackerCustomizer.removedService method.
 
Methods inherited from class org.osgi.util.tracker.ServiceTracker
close, getService, getService, getServiceReference, getServiceReferences, getServices, getTrackingCount, modifiedService, open, open, remove, size, waitForService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DispatcherTracker

public DispatcherTracker(BundleContext context,
                         String filter,
                         ServletConfig config)
                  throws Exception
Throws:
Exception
Method Detail

getDispatcher

public HttpServlet getDispatcher()

addingService

public Object addingService(ServiceReference ref)
Description copied from class: ServiceTracker
Default implementation of the ServiceTrackerCustomizer.addingService method.

This method is only called when this ServiceTracker has been constructed with a null ServiceTrackerCustomizer argument.

This implementation returns the result of calling getService on the BundleContext with which this ServiceTracker was created passing the specified ServiceReference.

This method can be overridden in a subclass to customize the service object to be tracked for the service being added. In that case, take care not to rely on the default implementation of removedService to unget the service.

Specified by:
addingService in interface ServiceTrackerCustomizer
Overrides:
addingService in class ServiceTracker
Parameters:
ref - The reference to the service being added to this ServiceTracker.
Returns:
The service object to be tracked for the service added to this ServiceTracker.
See Also:
ServiceTrackerCustomizer.addingService(ServiceReference)

removedService

public void removedService(ServiceReference ref,
                           Object service)
Description copied from class: ServiceTracker
Default implementation of the ServiceTrackerCustomizer.removedService method.

This method is only called when this ServiceTracker has been constructed with a null ServiceTrackerCustomizer argument.

This implementation calls ungetService, on the BundleContext with which this ServiceTracker was created, passing the specified ServiceReference.

This method can be overridden in a subclass. If the default implementation of addingService method was used, this method must unget the service.

Specified by:
removedService in interface ServiceTrackerCustomizer
Overrides:
removedService in class ServiceTracker
Parameters:
ref - The reference to removed service.
service - The service object for the removed service.
See Also:
ServiceTrackerCustomizer.removedService(ServiceReference, Object)


Copyright © 2011 Apache Software Foundation. All Rights Reserved.