org.openstreetmap.josm.io
Class DefaultProxySelector
java.lang.Object
java.net.ProxySelector
org.openstreetmap.josm.io.DefaultProxySelector
public class DefaultProxySelector
- extends java.net.ProxySelector
This is the default proxy selector used in JOSM.
Method Summary |
void |
connectFailed(java.net.URI uri,
java.net.SocketAddress sa,
java.io.IOException ioe)
|
void |
initFromPreferences()
Initializes the proxy selector from the setting in the preferences. |
protected int |
parseProxyPortValue(java.lang.String property,
java.lang.String value)
|
java.util.List<java.net.Proxy> |
select(java.net.URI uri)
|
static boolean |
willJvmRetrieveSystemProxies()
The ProxySelector provided by the JDK will retrieve proxy information
from the system settings, if the system property java.net.useSystemProxies
is defined at startup. |
Methods inherited from class java.net.ProxySelector |
getDefault, setDefault |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JVM_WILL_USE_SYSTEM_PROXIES
private static boolean JVM_WILL_USE_SYSTEM_PROXIES
- The
ProxySelector
provided by the JDK will retrieve proxy information
from the system settings, if the system property java.net.useSystemProxies
is defined at startup. It has no effect if the property is set
later by the application.
We therefore read the property at class loading time and remember it's value.
proxyPolicy
private ProxyPreferencesPanel.ProxyPolicy proxyPolicy
httpProxySocketAddress
private java.net.InetSocketAddress httpProxySocketAddress
socksProxySocketAddress
private java.net.InetSocketAddress socksProxySocketAddress
delegate
private java.net.ProxySelector delegate
DefaultProxySelector
public DefaultProxySelector(java.net.ProxySelector delegate)
- A typical example is:
PropertySelector delegate = PropertySelector.getDefault();
PropertySelector.setDefault(new DefaultPropertySelector(delegate));
- Parameters:
delegate
- the proxy selector to delegate to if system settings are used. Usually
this is the proxy selector found by ProxySelector.getDefault() before this proxy
selector is installed
willJvmRetrieveSystemProxies
public static boolean willJvmRetrieveSystemProxies()
- The
ProxySelector
provided by the JDK will retrieve proxy information
from the system settings, if the system property java.net.useSystemProxies
is defined at startup. If the property is set later by the application,
this has no effect.
- Returns:
- true, if java.net.useSystemProxies was set to true at class initialization time
parseProxyPortValue
protected int parseProxyPortValue(java.lang.String property,
java.lang.String value)
initFromPreferences
public void initFromPreferences()
- Initializes the proxy selector from the setting in the preferences.
connectFailed
public void connectFailed(java.net.URI uri,
java.net.SocketAddress sa,
java.io.IOException ioe)
- Specified by:
connectFailed
in class java.net.ProxySelector
select
public java.util.List<java.net.Proxy> select(java.net.URI uri)
- Specified by:
select
in class java.net.ProxySelector
JOSM