Author: ningjiang
Date: Wed Oct 12 14:15:04 2011
New Revision: 1182387
URL: http://svn.apache.org/viewvc?rev=1182387&view=rev
Log:
Merged revisions 1182369 via svnmerge from
https://svn.apache.org/repos/asf/camel/trunk
........
r1182369 | ningjiang | 2011-10-12 21:54:32 +0800 (Wed, 12 Oct 2011) | 1 line
CAMEL-4531 Added the option of workCount
........
Modified:
camel/branches/camel-2.8.x/ (props changed)
camel/branches/camel-2.8.x/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConfiguration.java
camel/branches/camel-2.8.x/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConsumer.java
Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
svn:mergeinfo = /camel/trunk:1182369
Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
camel/branches/camel-2.8.x/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConfiguration.java
URL:
http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConfiguration.java?rev=1182387&r1=1182386&r2=1182387&view=diff
==============================================================================
---
camel/branches/camel-2.8.x/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConfiguration.java
(original)
+++
camel/branches/camel-2.8.x/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConfiguration.java
Wed Oct 12 14:15:04 2011
@@ -68,6 +68,7 @@ public class NettyConfiguration implemen
private long receiveBufferSize = 65536;
private int corePoolSize = 10;
private int maxPoolSize = 100;
+ private int workerCount;
private String keyStoreFormat;
private String securityProvider;
private boolean disconnect;
@@ -483,5 +484,13 @@ public class NettyConfiguration implemen
public ServerPipelineFactory getServerPipelineFactory() {
return serverPipelineFactory;
}
+
+ public int getWorkerCount() {
+ return workerCount;
+ }
+
+ public void setWorkerCount(int workerCount) {
+ this.workerCount = workerCount;
+ }
}
Modified:
camel/branches/camel-2.8.x/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConsumer.java
URL:
http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConsumer.java?rev=1182387&r1=1182386&r2=1182387&view=diff
==============================================================================
---
camel/branches/camel-2.8.x/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConsumer.java
(original)
+++
camel/branches/camel-2.8.x/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConsumer.java
Wed Oct 12 14:15:04 2011
@@ -148,7 +148,12 @@ public class NettyConsumer extends Defau
ExecutorService workerExecutor =
context.getExecutorServiceStrategy().newThreadPool(this, "NettyTCPWorker",
configuration.getCorePoolSize(),
configuration.getMaxPoolSize());
- channelFactory = new NioServerSocketChannelFactory(bossExecutor,
workerExecutor);
+ if (configuration.getWorkerCount() == 0) {
+ channelFactory = new NioServerSocketChannelFactory(bossExecutor,
workerExecutor);
+ } else {
+ channelFactory = new NioServerSocketChannelFactory(bossExecutor,
workerExecutor,
+
configuration.getWorkerCount());
+ }
serverBootstrap = new ServerBootstrap(channelFactory);
if (configuration.getServerPipelineFactory() != null) {
configuration.getServerPipelineFactory().setConsumer(this);