camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [3/3] camel git commit: CAMEL-11131: Timer consumer - Should call start/stop of the processor
Date Mon, 10 Apr 2017 13:53:04 GMT
CAMEL-11131: Timer consumer - Should call start/stop of the processor


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

Branch: refs/heads/camel-2.17.x
Commit: cfb25cde12dc41f51f54f8c2bb6be1e240c0f390
Parents: d999f21
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Mon Apr 10 15:51:47 2017 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Mon Apr 10 15:52:53 2017 +0200

----------------------------------------------------------------------
 .../java/org/apache/camel/component/direct/DirectConsumer.java | 2 ++
 .../java/org/apache/camel/component/timer/TimerConsumer.java   | 6 +++++-
 .../camel/processor/loadbalancer/LoadBalancerConsumer.java     | 2 ++
 3 files changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/cfb25cde/camel-core/src/main/java/org/apache/camel/component/direct/DirectConsumer.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/direct/DirectConsumer.java
b/camel-core/src/main/java/org/apache/camel/component/direct/DirectConsumer.java
index 9b5c8d1..6bcd679 100644
--- a/camel-core/src/main/java/org/apache/camel/component/direct/DirectConsumer.java
+++ b/camel-core/src/main/java/org/apache/camel/component/direct/DirectConsumer.java
@@ -45,6 +45,7 @@ public class DirectConsumer extends DefaultConsumer implements ShutdownAware,
Su
 
     @Override
     protected void doStart() throws Exception {
+        super.doStart();
         // add consumer to endpoint
         boolean existing = this == endpoint.getConsumer();
         if (!existing && endpoint.hasConsumer(this)) {
@@ -58,6 +59,7 @@ public class DirectConsumer extends DefaultConsumer implements ShutdownAware,
Su
     @Override
     protected void doStop() throws Exception {
         endpoint.removeConsumer(this);
+        super.doStop();
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/camel/blob/cfb25cde/camel-core/src/main/java/org/apache/camel/component/timer/TimerConsumer.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/timer/TimerConsumer.java
b/camel-core/src/main/java/org/apache/camel/component/timer/TimerConsumer.java
index 62261cb..eedcd18 100644
--- a/camel-core/src/main/java/org/apache/camel/component/timer/TimerConsumer.java
+++ b/camel-core/src/main/java/org/apache/camel/component/timer/TimerConsumer.java
@@ -55,7 +55,9 @@ public class TimerConsumer extends DefaultConsumer implements StartupListener
{
 
     @Override
     protected void doStart() throws Exception {
-        if (endpoint.getDelay() >= 0) { 
+        super.doStart();
+
+        if (endpoint.getDelay() >= 0) {
             task = new TimerTask() {
                 // counter
                 private final AtomicLong counter = new AtomicLong();
@@ -128,6 +130,8 @@ public class TimerConsumer extends DefaultConsumer implements StartupListener
{
             endpoint.getCamelContext().getExecutorServiceManager().shutdown(executorService);
             executorService = null;
         }
+
+        super.doStop();
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/camel/blob/cfb25cde/camel-core/src/main/java/org/apache/camel/processor/loadbalancer/LoadBalancerConsumer.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/processor/loadbalancer/LoadBalancerConsumer.java
b/camel-core/src/main/java/org/apache/camel/processor/loadbalancer/LoadBalancerConsumer.java
index ec144c7..4ac4b0a 100644
--- a/camel-core/src/main/java/org/apache/camel/processor/loadbalancer/LoadBalancerConsumer.java
+++ b/camel-core/src/main/java/org/apache/camel/processor/loadbalancer/LoadBalancerConsumer.java
@@ -36,11 +36,13 @@ public class LoadBalancerConsumer extends DefaultConsumer {
 
     @Override
     protected void doStart() throws Exception {
+        super.doStart();
         loadBalancer.addProcessor(getProcessor());
     }
 
     @Override
     protected void doStop() throws Exception {
         loadBalancer.removeProcessor(getProcessor());
+        super.doStop();
     }
 }


Mime
View raw message