Class URLHandlersContentHandlerProxy
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 Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
private static final String
private final SecureAction
private static final Map
private final ContentHandlerFactory
private final String
private static final String
private static final Class[]
-
Constructor Summary
ConstructorsConstructorDescriptionURLHandlersContentHandlerProxy
(String mimeType, SecureAction action, ContentHandlerFactory factory) -
Method Summary
Modifier and TypeMethodDescriptionprivate ContentHandler
addToCache
(String mimeType, ContentHandler handler) private ContentHandler
getContent
(URLConnection urlc) private ContentHandler
Private method to retrieve the content handler service from the framework instance associated with the current call stack.Methods inherited from class java.net.ContentHandler
getContent
-
Field Details
-
STRING_TYPES
-
CONTENT_HANDLER_PACKAGE_PROP
- See Also:
-
DEFAULT_CONTENT_HANDLER_PACKAGE
- See Also:
-
m_builtIn
-
m_pkgs
-
m_factory
-
m_mimeType
-
m_action
-
-
Constructor Details
-
URLHandlersContentHandlerProxy
public URLHandlersContentHandlerProxy(String mimeType, SecureAction action, ContentHandlerFactory factory)
-
-
Method Details
-
getContent
- Specified by:
getContent
in classContentHandler
- Throws:
IOException
-
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
-
addToCache
-