Author: pferraro
Date: 2008-12-03 12:27:59 -0500 (Wed, 03 Dec 2008)
New Revision: 2092
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java
Log:
Create socketFactory lazily - config.isSSL() may not yet be set.
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java
===================================================================
---
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java 2008-12-03
16:03:52 UTC (rev 2091)
+++
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java 2008-12-03
17:27:59 UTC (rev 2092)
@@ -87,8 +87,6 @@
// ----------------------------------------------------------------- Fields
private final MCMPHandlerConfiguration config;
- /** Socket factory. */
- private final SocketFactory socketFactory;
/** Source for reset requests when we need to reset a proxy. */
private final ResetRequestSource resetRequestSource;
@@ -115,7 +113,6 @@
public DefaultMCMPHandler(MCMPHandlerConfiguration config, ResetRequestSource source)
{
this.resetRequestSource = source;
- this.socketFactory = config.isSsl() ? new JSSESocketFactory(config) :
SocketFactory.getDefault();
this.config = config;
}
@@ -173,7 +170,7 @@
private Proxy addProxyInternal(InetAddress address, int port)
{
- Proxy proxy = new Proxy(address, port, this.socketFactory, this.config);
+ Proxy proxy = new Proxy(address, port, this.config);
this.addRemoveProxiesLock.lock();
@@ -223,7 +220,7 @@
public void removeProxy(InetAddress address, int port)
{
- Proxy proxy = new Proxy(address, port, this.socketFactory, this.config);
+ Proxy proxy = new Proxy(address, port, this.config);
this.addRemoveProxiesLock.lock();
@@ -998,7 +995,7 @@
@GuardedBy("Proxy.this")
private volatile BufferedWriter writer = null;
- Proxy(InetAddress address, int port, SocketFactory socketFactory,
MCMPHandlerConfiguration config)
+ Proxy(InetAddress address, int port, MCMPHandlerConfiguration config)
{
if (address == null)
{
@@ -1011,7 +1008,7 @@
this.address = address;
this.port = port;
- this.socketFactory = socketFactory;
+ this.socketFactory = config.isSsl() ? new JSSESocketFactory(config) :
SocketFactory.getDefault();
this.socketTimeout = config.getSocketTimeout();
}
Show replies by date