Author: alessio.soldano(a)jboss.com
Date: 2009-09-16 13:09:04 -0400 (Wed, 16 Sep 2009)
New Revision: 10700
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/transport/NettyTransportHandler.java
Log:
[JBWS-2753] Use shared thread pool
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/transport/NettyTransportHandler.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/transport/NettyTransportHandler.java 2009-09-16
17:07:29 UTC (rev 10699)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/transport/NettyTransportHandler.java 2009-09-16
17:09:04 UTC (rev 10700)
@@ -28,6 +28,7 @@
import java.security.AccessController;
import java.util.Map;
import java.util.StringTokenizer;
+import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import org.jboss.logging.Logger;
@@ -71,6 +72,9 @@
//the keep alive timeout in seconds
private int keepAliveTimeout;
+ private static Executor bossExecutor = Executors.newCachedThreadPool();
+ private static Executor workerExecutor = Executors.newCachedThreadPool();
+
static
{
String keepAlive = AccessController.doPrivileged(new
java.security.PrivilegedAction<String>() {
@@ -93,7 +97,7 @@
{
this.url = url;
- factory = new NioClientSocketChannelFactory(Executors.newCachedThreadPool(),
Executors.newCachedThreadPool());
+ factory = new NioClientSocketChannelFactory(bossExecutor, workerExecutor);
ClientBootstrap bootstrap = new ClientBootstrap(factory);
bootstrap.setPipelineFactory(pipelineFactory);
@@ -307,7 +311,6 @@
{
channel.close();
}
- factory.releaseExternalResources();
}
public boolean getHttpKeepAliveSet()