java.net

Class ProxySelector

public abstract class ProxySelector extends Object

Class for handling proxies for different connections.

Since: 1.5

Constructor Summary
ProxySelector()
Creates a new ProxySelector object.
Method Summary
abstract voidconnectFailed(URI uri, SocketAddress address, IOException exception)
Signals to the selector that a proxy was no available.
static ProxySelectorgetDefault()
Returns the default proxy selector.
abstract List<Proxy>select(URI uri)
Returns the list of proxy settings for a given URI.
static voidsetDefault(ProxySelector selector)
Sets the default proxy selector.

Constructor Detail

ProxySelector

public ProxySelector()
Creates a new ProxySelector object.

Method Detail

connectFailed

public abstract void connectFailed(URI uri, SocketAddress address, IOException exception)
Signals to the selector that a proxy was no available.

Throws: IllegalArgumentException If one argument is null

getDefault

public static ProxySelector getDefault()
Returns the default proxy selector.

Returns: the default proxy selector

Throws: SecurityException If a security manager is installed and it denies NetPermission("getProxySelector")

select

public abstract List<Proxy> select(URI uri)
Returns the list of proxy settings for a given URI.

Returns: list of proxy settings

Throws: IllegalArgumentException If uri is null

setDefault

public static void setDefault(ProxySelector selector)
Sets the default proxy selector.

Parameters: selector the defualt proxy selector

Throws: SecurityException If a security manager is installed and it denies NetPermission("setProxySelector")