public class ContentHandlerProxy extends ContentHandler implements ServiceTrackerCustomizer<ContentHandler,ServiceReference<ContentHandler>>
| Modifier and Type | Field and Description |
|---|---|
protected ServiceReference<ContentHandler> |
contentHandlerServiceReference |
protected ServiceTracker<ContentHandler,ServiceReference<ContentHandler>> |
contentHandlerServiceTracker |
protected String |
contentType |
protected BundleContext |
context |
protected int |
ranking |
protected ContentHandler |
realHandler |
| Constructor and Description |
|---|
ContentHandlerProxy(String contentType,
ServiceReference<ContentHandler> reference,
BundleContext context) |
| Modifier and Type | Method and Description |
|---|---|
ServiceReference<ContentHandler> |
addingService(ServiceReference<ContentHandler> reference)
A service is being added to the
ServiceTracker. |
Object |
getContent(URLConnection uConn) |
void |
modifiedService(ServiceReference<ContentHandler> reference,
ServiceReference<ContentHandler> service)
A service tracked by the
ServiceTracker has been modified. |
void |
removedService(ServiceReference<ContentHandler> reference,
ServiceReference<ContentHandler> service)
A service tracked by the
ServiceTracker has been removed. |
getContentprotected ContentHandler realHandler
protected ServiceTracker<ContentHandler,ServiceReference<ContentHandler>> contentHandlerServiceTracker
protected BundleContext context
protected ServiceReference<ContentHandler> contentHandlerServiceReference
protected String contentType
protected int ranking
public ContentHandlerProxy(String contentType, ServiceReference<ContentHandler> reference, BundleContext context)
public ServiceReference<ContentHandler> addingService(ServiceReference<ContentHandler> reference)
ServiceTrackerCustomizerServiceTracker.
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.
addingService in interface ServiceTrackerCustomizer<ContentHandler,ServiceReference<ContentHandler>>reference - The reference to the service being added to the
ServiceTracker.null if the specified referenced service
should not be tracked.ServiceTrackerCustomizer.addingService(ServiceReference)public void modifiedService(ServiceReference<ContentHandler> reference, ServiceReference<ContentHandler> service)
ServiceTrackerCustomizerServiceTracker has been modified.
This method is called when a service being tracked by the
ServiceTracker has had it properties modified.
modifiedService in interface ServiceTrackerCustomizer<ContentHandler,ServiceReference<ContentHandler>>reference - The reference to the service that has been modified.service - The service object for the specified referenced service.ServiceTrackerCustomizer.modifiedService(ServiceReference, Object)public void removedService(ServiceReference<ContentHandler> reference, ServiceReference<ContentHandler> service)
ServiceTrackerCustomizerServiceTracker has been removed.
This method is called after a service is no longer being tracked by the
ServiceTracker.
removedService in interface ServiceTrackerCustomizer<ContentHandler,ServiceReference<ContentHandler>>reference - The reference to the service that has been removed.service - The service object for the specified referenced service.ServiceTrackerCustomizer.removedService(ServiceReference, Object)public Object getContent(URLConnection uConn) throws IOException
getContent in class ContentHandlerIOExceptionContentHandler.getContent(URLConnection)Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.