Class URLHandlersContentHandlerProxy

java.lang.Object
java.net.ContentHandler
org.apache.felix.framework.URLHandlersContentHandlerProxy

class URLHandlersContentHandlerProxy extends ContentHandler

This class implements a content handler proxy. When the content handler proxy instance is created, it is associated with a particular mime type and will answer all future requests for content of that type. It does not directly handle the content requests, but delegates the requests to an underlying content handler service.

The proxy for a particular mime type is used for all framework instances that may contain their own content handler services. When performing a content handler operation, the proxy retrieves the handler service from the framework instance associated with the current call stack and delegates the call to the handler service.

The proxy will create simple content handler service trackers for each framework instance. The trackers will listen to service events in its respective framework instance to maintain a reference to the "best" content handler service at any given time.

  • Field Details

  • Constructor Details

  • Method Details

    • getContent

      public Object getContent(URLConnection urlc) throws IOException
      Specified by:
      getContent in class ContentHandler
      Throws:
      IOException
    • getContentHandlerService

      private ContentHandler getContentHandlerService()

      Private method to retrieve the content handler service from the framework instance associated with the current call stack. A simple service tracker is created and cached for the associated framework instance when this method is called.

      Returns:
      the content handler service from the framework instance associated with the current call stack or null is no service is available.
    • getBuiltIn

      private ContentHandler getBuiltIn()