diff options
author | Jiri Vanek <[email protected]> | 2013-09-25 18:50:18 +0200 |
---|---|---|
committer | Jiri Vanek <[email protected]> | 2013-09-25 18:50:18 +0200 |
commit | 19e74fe5dacd03e0cb5582f840e15262e39fe24f (patch) | |
tree | 38ffc4f47f7641f8d20ba0e0e8a97a97ffb1db64 /netx/net/sourceforge/jnlp/runtime/JNLPProxySelector.java | |
parent | fcd5c4c69fc5ea84b04f309eb40e295eab921fd8 (diff) |
Introduced logging bottleneck
Diffstat (limited to 'netx/net/sourceforge/jnlp/runtime/JNLPProxySelector.java')
-rw-r--r-- | netx/net/sourceforge/jnlp/runtime/JNLPProxySelector.java | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/netx/net/sourceforge/jnlp/runtime/JNLPProxySelector.java b/netx/net/sourceforge/jnlp/runtime/JNLPProxySelector.java index efcf62e..e92b2c9 100644 --- a/netx/net/sourceforge/jnlp/runtime/JNLPProxySelector.java +++ b/netx/net/sourceforge/jnlp/runtime/JNLPProxySelector.java @@ -33,6 +33,7 @@ import java.util.List; import java.util.StringTokenizer; import net.sourceforge.jnlp.config.DeploymentConfiguration; +import net.sourceforge.jnlp.util.logging.OutputController; /** * A ProxySelector specific to JNLPs. This proxy uses the deployment @@ -97,7 +98,7 @@ public abstract class JNLPProxySelector extends ProxySelector { try { autoConfigUrl = new URL(autoConfigString); } catch (MalformedURLException e) { - e.printStackTrace(); + OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } } @@ -159,7 +160,7 @@ public abstract class JNLPProxySelector extends ProxySelector { try { proxyPort = Integer.valueOf(port); } catch (NumberFormatException e) { - e.printStackTrace(); + OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } } return proxyPort; @@ -170,7 +171,7 @@ public abstract class JNLPProxySelector extends ProxySelector { */ @Override public void connectFailed(URI uri, SocketAddress sa, IOException ioe) { - ioe.printStackTrace(); + OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ioe); } /** @@ -178,15 +179,11 @@ public abstract class JNLPProxySelector extends ProxySelector { */ @Override public List<Proxy> select(URI uri) { - if (JNLPRuntime.isDebug()) { - System.out.println("Selecting proxy for: " + uri); - } - + OutputController.getLogger().log("Selecting proxy for: " + uri); + if (inBypassList(uri)) { List<Proxy> proxies = Arrays.asList(new Proxy[] { Proxy.NO_PROXY }); - if (JNLPRuntime.isDebug()) { - System.out.println("Selected proxies: " + Arrays.toString(proxies.toArray())); - } + OutputController.getLogger().log("Selected proxies: " + Arrays.toString(proxies.toArray())); return proxies; } @@ -211,9 +208,7 @@ public abstract class JNLPProxySelector extends ProxySelector { break; } - if (JNLPRuntime.isDebug()) { - System.out.println("Selected proxies: " + Arrays.toString(proxies.toArray())); - } + OutputController.getLogger().log("Selected proxies: " + Arrays.toString(proxies.toArray())); return proxies; } @@ -344,7 +339,7 @@ public abstract class JNLPProxySelector extends ProxySelector { String proxiesString = pacEvaluator.getProxies(uri.toURL()); proxies.addAll(getProxiesFromPacResult(proxiesString)); } catch (MalformedURLException e) { - e.printStackTrace(); + OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); proxies.add(Proxy.NO_PROXY); } @@ -403,9 +398,7 @@ public abstract class JNLPProxySelector extends ProxySelector { } else if (token.startsWith("DIRECT")) { proxies.add(Proxy.NO_PROXY); } else { - if (JNLPRuntime.isDebug()) { - System.out.println("Unrecognized proxy token: " + token); - } + OutputController.getLogger().log("Unrecognized proxy token: " + token); } } |