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. |
getContent
protected 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)
ServiceTrackerCustomizer
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.
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)
ServiceTrackerCustomizer
ServiceTracker
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)
ServiceTrackerCustomizer
ServiceTracker
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 ContentHandler
IOException
ContentHandler.getContent(URLConnection)
Copyright © 2007–2018 The Apache Software Foundation. All rights reserved.