com.ihr.xbrl.util
Class InternetProxySelector
java.lang.Object
java.net.ProxySelector
com.ihr.xbrl.util.InternetProxySelector
public class InternetProxySelector
- extends java.net.ProxySelector
Configures the internet proxy
Based on code form jean-christophe.collet@sun.com
see page
An instance of this class is created when a DTSContainer is created. During the initialization
of this class, the static ProxySelector is get and if it is not an instance of this class it is
set to the created instance. If the ProxySelector is an instance of this class it is reused,
new proxies are added to the existing instance. Existing proxies remains untouched. If
a proxy that is banned (due to inactivity) is added it is ignored.
Adding proxies is done by adding properties to the new DTS being created. Properties are read by this class
and proxies are configured accordingly. The following properties are recognized and used:
- http://www.reportingstandard.com/properties/proxy/address/{n} this is the proxy internet address
- http://www.reportingstandard.com/properties/proxy/port/{n} this is the proxy port (no default values are inferred at this point)
- http://www.reportingstandard.com/properties/proxy/type/{n} this is either "HTTP" or "SOCKS" indicating the proxy type
Where {n} is a sequential number starting with 0.
If no property exist, the list of proxies is finished. In order to add a proxy to the list the three
properties ending with a number must exist.
According to the API, the ProxySelector is static, therefore all DTSContainers will share the same
- Author:
- Ignacio
|
Method Summary |
void |
connectFailed(java.net.URI uri,
java.net.SocketAddress sa,
java.io.IOException ioe)
|
boolean |
isRegistered()
During the instance creation, the InternetProxySelector is registered
as the default proxy selector if there are properties indicating that
it must be registered. |
java.util.List<java.net.Proxy> |
select(java.net.URI uri)
|
| Methods inherited from class java.net.ProxySelector |
getDefault, setDefault |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
proxyPropertyHeader
public static final java.lang.String proxyPropertyHeader
- See Also:
- Constant Field Values
proxyAddress
public static final java.lang.String proxyAddress
- See Also:
- Constant Field Values
proxyPort
public static final java.lang.String proxyPort
- See Also:
- Constant Field Values
proxyType
public static final java.lang.String proxyType
- See Also:
- Constant Field Values
noProxyFor
public static final java.lang.String noProxyFor
- See Also:
- Constant Field Values
InternetProxySelector
public InternetProxySelector(java.util.Properties props)
isRegistered
public boolean isRegistered()
- During the instance creation, the InternetProxySelector is registered
as the default proxy selector if there are properties indicating that
it must be registered. This method returns true if the InternetProxySelector
instance is registered as the default ProxySelector.
- Returns:
- boolean value
select
public java.util.List<java.net.Proxy> select(java.net.URI uri)
- Specified by:
select in class java.net.ProxySelector
connectFailed
public void connectFailed(java.net.URI uri,
java.net.SocketAddress sa,
java.io.IOException ioe)
- Specified by:
connectFailed in class java.net.ProxySelector
Copyright 2006-2009 Reporting Standard S.L., C/ Torrecilla del Puerto 1, 28043, Madrid, Espaņa