You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2014/10/17 10:22:31 UTC
[3/3] git commit: CAMEL-7915 Share the HashedWheelTimer across the
Camel NettyComponent
CAMEL-7915 Share the HashedWheelTimer across the Camel NettyComponent
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/08b491d9
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/08b491d9
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/08b491d9
Branch: refs/heads/master
Commit: 08b491d9d2c8902834221582eb6b238393a72dd0
Parents: feea16a
Author: Willem Jiang <wi...@gmail.com>
Authored: Fri Oct 17 16:20:21 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Fri Oct 17 16:20:21 2014 +0800
----------------------------------------------------------------------
.../apache/camel/component/netty/NettyProducer.java | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/08b491d9/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyProducer.java b/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyProducer.java
index 87ad2be..7be6a21 100644
--- a/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyProducer.java
+++ b/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyProducer.java
@@ -51,8 +51,6 @@ import org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory;
import org.jboss.netty.channel.socket.nio.NioDatagramChannelFactory;
import org.jboss.netty.channel.socket.nio.NioDatagramWorkerPool;
import org.jboss.netty.channel.socket.nio.WorkerPool;
-import org.jboss.netty.util.HashedWheelTimer;
-import org.jboss.netty.util.Timer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -68,7 +66,7 @@ public class NettyProducer extends DefaultAsyncProducer {
private BossPool bossPool;
private WorkerPool workerPool;
private ObjectPool<Channel> pool;
- private Timer timer;
+
public NettyProducer(NettyEndpoint nettyEndpoint, NettyConfiguration configuration) {
super(nettyEndpoint);
@@ -126,8 +124,6 @@ public class NettyProducer extends DefaultAsyncProducer {
}
}
- timer = new HashedWheelTimer();
-
// setup pipeline factory
ClientPipelineFactory factory = configuration.getClientPipelineFactory();
if (factory != null) {
@@ -180,11 +176,6 @@ public class NettyProducer extends DefaultAsyncProducer {
pool = null;
}
- if (timer != null) {
- timer.stop();
- timer = null;
- }
-
super.doStop();
}
@@ -337,7 +328,7 @@ public class NettyProducer extends DefaultAsyncProducer {
if (bp == null) {
// create new pool which we should shutdown when stopping as its not shared
bossPool = new NettyClientBossPoolBuilder()
- .withTimer(timer)
+ .withTimer(getEndpoint().getTimer())
.withBossCount(configuration.getBossCount())
.withName("NettyClientTCPBoss")
.build();