java.lang.Object | |
↳ | java.net.ProxySelector |
Selects an applicable proxy server when connecting to a resource specified by
a URL. Proxy selectors are concrete subclasses of ProxySelector
and
can be set as default by calling the setDefault()
method. If a
connection can't be established, the caller should notify the proxy selector
by invoking the connectFailed()
method.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new
ProxySelector instance. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Notifies the
ProxySelector that a connection to the proxy server
could not be established. | |||||||||||
Gets the default
ProxySelector of the system. | |||||||||||
Gets all applicable proxies based on the accessing protocol of
uri . | |||||||||||
Sets the default
ProxySelector of the system. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object
|
Creates a new ProxySelector
instance.
Notifies the ProxySelector
that a connection to the proxy server
could not be established. A concrete implementation should upon this
notification maintain the list of available proxies, since an updated
version should be provided by select()
.
uri | the URI to which the connection could not be established. |
---|---|
sa | the address of the proxy. |
ioe | the exception which was thrown during connection establishment. |
Gets the default ProxySelector
of the system.
ProxySelector
.SecurityException | if a security manager is installed but it doesn't have the NetPermission("getProxySelector"). |
---|
Gets all applicable proxies based on the accessing protocol of uri
. The format of URI is defined as below:
uri | the target URI object. |
---|
Proxy.NO_PROXY
element.Sets the default ProxySelector
of the system. Removes the system
default ProxySelector
if the parameter selector
is set to
null
.
selector | the ProxySelector instance to set as default or
null to remove the current default ProxySelector . |
---|
SecurityException | if a security manager is installed but it doesn't have the NetPermission("setProxySelector"). |
---|