Class URLHandlersStreamHandlerProxy
- All Implemented Interfaces:
InvocationHandler,URLStreamHandlerSetter
This class implements a stream handler proxy. When the stream handler proxy instance is created, it is associated with a particular protocol and will answer all future requests for handling of that stream type. It does not directly handle the stream handler requests, but delegates the requests to an underlying stream handler service.
The proxy instance for a particular protocol is used for all framework instances that may contain their own stream handler services. When performing a stream 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 stream 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" stream handler service at any given time.
-
Constructor Summary
ConstructorsConstructorDescriptionURLHandlersStreamHandlerProxy(String protocol, SecureAction action, URLStreamHandler builtIn, URL builtInURL) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanprotected intprotected InetAddressgetHostAddress(URL url) protected intprotected booleanhostsEqual(URL url1, URL url2) protected URLConnectionopenConnection(URL url) protected URLConnectionopenConnection(URL url, Proxy proxy) protected voidprotected booleanvoidvoidsetURL(URL url, String protocol, String host, int port, String authority, String userInfo, String path, String query, String ref) protected StringtoExternalForm(URL url)
-
Constructor Details
-
URLHandlersStreamHandlerProxy
public URLHandlersStreamHandlerProxy(String protocol, SecureAction action, URLStreamHandler builtIn, URL builtInURL)
-
-
Method Details
-
equals
- Overrides:
equalsin classURLStreamHandler
-
getDefaultPort
protected int getDefaultPort()- Overrides:
getDefaultPortin classURLStreamHandler
-
getHostAddress
- Overrides:
getHostAddressin classURLStreamHandler
-
hashCode
- Overrides:
hashCodein classURLStreamHandler
-
hostsEqual
- Overrides:
hostsEqualin classURLStreamHandler
-
openConnection
- Specified by:
openConnectionin classURLStreamHandler- Throws:
IOException
-
openConnection
- Overrides:
openConnectionin classURLStreamHandler- Throws:
IOException
-
parseURL
- Overrides:
parseURLin classURLStreamHandler
-
sameFile
- Overrides:
sameFilein classURLStreamHandler
-
setURL
public void setURL(URL url, String protocol, String host, int port, String authority, String userInfo, String path, String query, String ref) - Specified by:
setURLin interfaceURLStreamHandlerSetter- Overrides:
setURLin classURLStreamHandler- See Also:
-
setURL
- Specified by:
setURLin interfaceURLStreamHandlerSetter- Overrides:
setURLin classURLStreamHandler- See Also:
-
toExternalForm
- Overrides:
toExternalFormin classURLStreamHandler
-
invoke
- Specified by:
invokein interfaceInvocationHandler- Throws:
Throwable
-