| public abstract class java.net ProxySelector
|
Java SE 6 |
setDefault method. The
currently registered proxy selector can be retrieved by calling
getDefault method.
When a proxy selector is registered, for instance, a subclass
of URLConnection class should call the select
method for each URL request so that the proxy selector can decide
if a direct, or proxied connection should be used. The select method returns an iterator over a collection with
the preferred connection approach.
If a connection cannot be established to a proxy (PROXY or
SOCKS) servers then the caller should call the proxy selector's
connectFailed method to notify the proxy
selector that the proxy server is unavailable.
| version | 1.3, 03/08/09 |
| since | 1.5 |
| Constructors | |
|---|---|
| public | ProxySelector() |
| Methods | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| abstract public void | connectFailed(URI uri, SocketAddress sa, IOException ioe) Details
Called to indicate that a connection could not be established
to a proxy/socks server. An implementation of this method can
temporarily remove the proxies or reorder the sequence of
proxies returned by select(String, String), using the address
and they kind of IOException given.
| ||||||||
| abstract public List | select(URI uri) Details
Selects all the applicable proxies based on the protocol to
access the resource with and a destination address to access
the resource at.
The format of the URI is defined as follow:
| ||||||||
| Properties | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| public static void | setDefault(ProxySelector ps) Details
Sets (or unsets) the system-wide proxy selector.
Note: non-standard protocol handlers may ignore this setting.
| ||||||||
| public static ProxySelector | getDefault() Details
Gets the system-wide proxy selector.
| ||||||||
| About DocWeb · Bundles · Export · Export All | Top 10 · Statistics · Login |
| About Sun · Contact · Privacy · Terms of Use · Trademarks | Java SE 6 · Copyright © 1994-2009 Sun Microsystems, Inc.All rights reserved. Use is subject to license terms |
![]() |
![]() |
|