|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.net.ContentHandler
org.eclipse.osgi.framework.internal.protocol.ContentHandlerProxy
public class ContentHandlerProxy
The ContentHandlerProxy is a ContentHandler that acts as a proxy for registered ContentHandlers. When a ContentHandler is requested from the ContentHandlerFactory and it exists in the service registry, a ContentHandlerProxy is created which will pass all the requests from the requestor to the real ContentHandler. We can't return the real ContentHandler from the ContentHandlerFactory because the JVM caches ContentHandlers and therefore would not support a dynamic environment of ContentHandlers being registered and unregistered.
| Field Summary | |
|---|---|
protected ServiceReference<ContentHandler> |
contentHandlerServiceReference
|
protected ServiceTracker<ContentHandler,ServiceReference<ContentHandler>> |
contentHandlerServiceTracker
|
protected String |
contentType
|
protected BundleContext |
context
|
protected int |
ranking
|
protected ContentHandler |
realHandler
|
| Constructor Summary | |
|---|---|
ContentHandlerProxy(String contentType,
ServiceReference<ContentHandler> reference,
BundleContext context)
|
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.net.ContentHandler |
|---|
getContent |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ContentHandler realHandler
protected ServiceTracker<ContentHandler,ServiceReference<ContentHandler>> contentHandlerServiceTracker
protected BundleContext context
protected ServiceReference<ContentHandler> contentHandlerServiceReference
protected String contentType
protected int ranking
| Constructor Detail |
|---|
public ContentHandlerProxy(String contentType,
ServiceReference<ContentHandler> reference,
BundleContext context)
| Method Detail |
|---|
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)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||