| java.lang.Object | |
| ↳ | java.net.ProxySelector |
Selects applicable proxies when connecting to network resouce represented by
a URI. An implementation of ProxySelector
should be a concrete subclass of ProxySelector. Method
select returns a list of proxies according to the
uri. If a connection can't be established, the caller should
notify proxy selector by invoking connectFailed method.
A proxy selector can be registered/unregistered by calling
setDefault method and retrieved by calling
getDefault method.
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Constructor method.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
If the connection can not be established to the proxy server, this method
will be called.
| |||||||||||
Gets system default
ProxySelector. | |||||||||||
Gets applicable proxies based on the accessing protocol of
uri. | |||||||||||
Sets system default
ProxySelector. | |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object
| |||||||||||
Constructor method.
If the connection can not be established to the proxy server, this method
will be called. An implementation may adjust proxy the sequence of
proxies returned by select(String, String).
| uri | the URI that the connection fails to connect
to. |
|---|---|
| sa | SocketAddress of the proxy. |
| ioe | The IOException which is thrown during
connection establishment. |
| IllegalArgumentException | If any argument is null. |
|---|
Gets system default ProxySelector.
ProxySelector.If a security manager is installed and it doesn't have
NetPermission("getProxySelector").
|
Gets applicable proxies based on the accessing protocol of
uri. The format of URI is defined as below:
| uri | the destination URI object. |
|---|
Proxy.NO_PROXY.| IllegalArgumentException | If any argument is null. |
|---|
Sets system default ProxySelector. Unsets system default
ProxySelector if selector is null.
If a security manager is installed and it doesn't have
NetPermission("setProxySelector").
|