Author: richard.opalka(a)jboss.com
Date: 2011-01-28 05:20:07 -0500 (Fri, 28 Jan 2011)
New Revision: 13632
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java
Log:
[JBPAPP-5748] configure remoting to prevent socket leaks
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java 2011-01-28
10:17:37 UTC (rev 13631)
+++
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java 2011-01-28
10:20:07 UTC (rev 13632)
@@ -75,6 +75,8 @@
private static Logger log = Logger.getLogger(HTTPRemotingConnection.class);
private static final String REMOTING_DESTRUCTION_DELAY =
System.getProperty("org.jboss.ws.client.remoting.destruction.delay",
"5000");
+ private static final String REMOTING_DISCONNECT_AFTER_USE =
+ System.getProperty("org.jboss.ws.client.remoting.disconnect.after.use",
"true");
private Map<String, Object> clientConfig = new HashMap<String, Object>();
@@ -203,6 +205,9 @@
locator = new InvokerLocator(targetAddress);
locator.getParameters().put(Client.INVOKER_DESTRUCTION_DELAY,
REMOTING_DESTRUCTION_DELAY); // [JBPAPP-5826] reuse SSL sessions
+ // TODO: Use HTTPClientInvoker.DISCONNECT_AFTER_USE instead of hardcoded string
+ // "disconnectAfterUse" once Remoting 2.5.3.SP2 is released to maven
repository.
+ locator.getParameters().put("disconnectAfterUse",
REMOTING_DISCONNECT_AFTER_USE); // [JBPAPP-5748] prevent socket leaks
}
catch (MalformedURLException e)
{