|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.net.ProxySelector
public abstract class 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.
| Constructor Summary | |
|---|---|
ProxySelector()
Constructor method. |
|
| Method Summary | |
|---|---|
abstract void |
connectFailed(URI uri,
SocketAddress sa,
IOException ioe)
If the connection can not be established to the proxy server, this method will be called. |
static ProxySelector |
getDefault()
Gets system default ProxySelector. |
abstract List<Proxy> |
select(URI uri)
Gets applicable proxies based on the accessing protocol of uri. |
static void |
setDefault(ProxySelector selector)
Sets system default ProxySelector. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ProxySelector()
| Method Detail |
|---|
public static ProxySelector getDefault()
ProxySelector.
ProxySelector.
SecurtiyException - If a security manager is installed and it doesn't have
NetPermission("getProxySelector").public static void setDefault(ProxySelector selector)
ProxySelector. Unsets system default
ProxySelector if selector is null.
SecurtiyException - If a security manager is installed and it doesn't have
NetPermission("setProxySelector").public abstract List<Proxy> select(URI uri)
uri. The format of URI is defined as below:
uri - the destination URI object.
Proxy.NO_PROXY.
IllegalArgumentException - If any argument is null.
public abstract void connectFailed(URI uri,
SocketAddress sa,
IOException ioe)
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.
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||