public class URLHandlersStreamHandlerProxy extends URLStreamHandler implements URLStreamHandlerSetter, InvocationHandler
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 and Description |
---|
URLHandlersStreamHandlerProxy(String protocol,
SecureAction action,
URLStreamHandler builtIn,
URL builtInURL) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
equals(URL url1,
URL url2) |
protected int |
getDefaultPort() |
protected InetAddress |
getHostAddress(URL url) |
protected int |
hashCode(URL url) |
protected boolean |
hostsEqual(URL url1,
URL url2) |
Object |
invoke(Object obj,
Method method,
Object[] params) |
protected URLConnection |
openConnection(URL url) |
protected URLConnection |
openConnection(URL url,
Proxy proxy) |
protected void |
parseURL(URL url,
String spec,
int start,
int limit) |
protected boolean |
sameFile(URL url1,
URL url2) |
void |
setURL(URL url,
String protocol,
String host,
int port,
String file,
String ref) |
void |
setURL(URL url,
String protocol,
String host,
int port,
String authority,
String userInfo,
String path,
String query,
String ref) |
protected String |
toExternalForm(URL url) |
public URLHandlersStreamHandlerProxy(String protocol, SecureAction action, URLStreamHandler builtIn, URL builtInURL)
protected boolean equals(URL url1, URL url2)
equals
in class URLStreamHandler
protected int getDefaultPort()
getDefaultPort
in class URLStreamHandler
protected InetAddress getHostAddress(URL url)
getHostAddress
in class URLStreamHandler
protected int hashCode(URL url)
hashCode
in class URLStreamHandler
protected boolean hostsEqual(URL url1, URL url2)
hostsEqual
in class URLStreamHandler
protected URLConnection openConnection(URL url) throws IOException
openConnection
in class URLStreamHandler
IOException
protected URLConnection openConnection(URL url, Proxy proxy) throws IOException
openConnection
in class URLStreamHandler
IOException
protected void parseURL(URL url, String spec, int start, int limit)
parseURL
in class URLStreamHandler
protected boolean sameFile(URL url1, URL url2)
sameFile
in class URLStreamHandler
public void setURL(URL url, String protocol, String host, int port, String authority, String userInfo, String path, String query, String ref)
setURL
in interface URLStreamHandlerSetter
setURL
in class URLStreamHandler
public void setURL(URL url, String protocol, String host, int port, String file, String ref)
setURL
in interface URLStreamHandlerSetter
setURL
in class URLStreamHandler
protected String toExternalForm(URL url)
toExternalForm
in class URLStreamHandler
Copyright © 2006–2016 The Apache Software Foundation. All rights reserved.