Name
ProxySelector
Synopsis
An implementation of this abstract class
can be used to automatically select one or more
Proxy objects to use to connect to a specified
URL. Install an implementation of this class with
the setDefault( )
method. URLConnection implementations use the
installed ProxySelector, if there is one, and call
select( )
to
obtain a list of suitable Proxy objects for the
connection. If a URLConnection cannot contact the
proxy server specified in a Proxy object, it calls
the connectFailed( ) method to notify the
ProxySelector object of the failure.
This class is intended to be implemented by advanced users of
java.net and is not for casual use.
public abstract class ProxySelector { // Public Constructors public ProxySelector( ); // Public Class Methods public static ProxySelector getDefault( ); public static void setDefault(ProxySelector ps); // Public Instance Methods public abstract void connectFailed(URI uri, SocketAddress sa, java.io.IOException ioe); public abstract java.util.List<java.net.Proxy> select(URI uri); }
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access