camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [1/3] git commit: CAMEL-7391: camel-netty - NettyProduce should use timer from component instead of creating new timer per producer
Date Thu, 24 Apr 2014 13:44:51 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.12.x 8fe99ba2e -> 8fa0c9f73
  refs/heads/camel-2.13.x 5dd561ddb -> ce489dc40
  refs/heads/master bfca1f486 -> 5d5591e19


CAMEL-7391: camel-netty - NettyProduce should use timer from component instead of creating
new timer per producer


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5d5591e1
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5d5591e1
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5d5591e1

Branch: refs/heads/master
Commit: 5d5591e19be035a9a518281f72d9862652bb129a
Parents: bfca1f4
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Thu Apr 24 15:42:58 2014 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Thu Apr 24 15:42:58 2014 +0200

----------------------------------------------------------------------
 .../component/netty/NettyClientBossPoolBuilder.java   | 14 ++++++++++++--
 .../apache/camel/component/netty/NettyProducer.java   |  1 +
 2 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/5d5591e1/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyClientBossPoolBuilder.java
----------------------------------------------------------------------
diff --git a/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyClientBossPoolBuilder.java
b/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyClientBossPoolBuilder.java
index 76bd3f9..1b9bee2 100644
--- a/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyClientBossPoolBuilder.java
+++ b/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyClientBossPoolBuilder.java
@@ -20,7 +20,7 @@ import java.util.concurrent.Executors;
 
 import org.jboss.netty.channel.socket.nio.BossPool;
 import org.jboss.netty.channel.socket.nio.NioClientBossPool;
-import org.jboss.netty.util.HashedWheelTimer;
+import org.jboss.netty.util.Timer;
 
 /**
  * A builder to create Netty {@link org.jboss.netty.channel.socket.nio.BossPool} which can
be used for sharing boos pools
@@ -31,6 +31,7 @@ public final class NettyClientBossPoolBuilder {
     private String name = "NettyClientBoss";
     private String pattern;
     private int bossCount = 1;
+    private Timer timer;
 
     public void setName(String name) {
         this.name = name;
@@ -44,6 +45,10 @@ public final class NettyClientBossPoolBuilder {
         this.bossCount = bossCount;
     }
 
+    public void setTimer(Timer timer) {
+        this.timer = timer;
+    }
+
     public NettyClientBossPoolBuilder withName(String name) {
         setName(name);
         return this;
@@ -59,10 +64,15 @@ public final class NettyClientBossPoolBuilder {
         return this;
     }
 
+    public NettyClientBossPoolBuilder withTimer(Timer timer) {
+        setTimer(timer);
+        return this;
+    }
+
     /**
      * Creates a new boss pool.
      */
     BossPool build() {
-        return new NioClientBossPool(Executors.newCachedThreadPool(), bossCount, new HashedWheelTimer(),
new CamelNettyThreadNameDeterminer(pattern, name));
+        return new NioClientBossPool(Executors.newCachedThreadPool(), bossCount, timer, new
CamelNettyThreadNameDeterminer(pattern, name));
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/5d5591e1/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 9e318d3..f0758c8 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
@@ -327,6 +327,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(getEndpoint().getTimer())
                         .withBossCount(configuration.getBossCount())
                         .withName("NettyClientTCPBoss")
                         .build();


Mime
View raw message