camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1226430 - in /camel/trunk/camel-core/src/main/java/org/apache/camel: component/browse/ component/dataset/ component/timer/ impl/ processor/interceptor/
Date Mon, 02 Jan 2012 14:25:33 GMT
Author: davsclaus
Date: Mon Jan  2 14:25:33 2012
New Revision: 1226430

URL: http://svn.apache.org/viewvc?rev=1226430&view=rev
Log:
CAMEL-4792: Use doStart/doStop over start/stop if extending ServiceSupport, which ensures
ServiceSupport can keep track of the state.

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/browse/BrowseEndpoint.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetEndpoint.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/LimitedPollingConsumerPollStrategy.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/Tracer.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/browse/BrowseEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/browse/BrowseEndpoint.java?rev=1226430&r1=1226429&r2=1226430&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/browse/BrowseEndpoint.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/browse/BrowseEndpoint.java
Mon Jan  2 14:25:33 2012
@@ -89,14 +89,18 @@ public class BrowseEndpoint extends Defa
         loadBalancer.process(exchange);
     }
 
-    public void start() throws Exception {
+    @Override
+    protected void doStart() throws Exception {
         exchanges = createExchangeList();
+        super.doStart();
     }
 
-    public void stop() throws Exception {
+    @Override
+    protected void doStop() throws Exception {
         if (exchanges != null) {
             exchanges.clear();
             exchanges = null;
         }
+        super.doStop();
     }
 }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetEndpoint.java?rev=1226430&r1=1226429&r2=1226430&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetEndpoint.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetEndpoint.java
Mon Jan  2 14:25:33 2012
@@ -215,17 +215,16 @@ public class DataSetEndpoint extends Moc
         return answer;
     }
 
-    public void start() throws Exception {
+    @Override
+    protected void doStart() throws Exception {
+        super.doStart();
+
         long size = getDataSet().getSize();
         expectedMessageCount((int) size);
         if (reporter == null) {
             reporter = createReporter();
         }
-        log.info("Start: " + this + " expecting " + size + " messages");
-    }
-
-    public void stop() throws Exception {
-        log.info("Stop: " + this);
+        log.info(this + " expecting " + size + " messages");
     }
 
 }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java?rev=1226430&r1=1226429&r2=1226430&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java
Mon Jan  2 14:25:33 2012
@@ -60,12 +60,16 @@ public class TimerEndpoint extends Defau
         return new TimerConsumer(this, processor);
     }
 
-    public void start() throws Exception {
+    @Override
+    protected void doStart() throws Exception {
+        super.doStart();
         // do nothing, the timer will be set when the first consumer will request it
     }
 
-    public void stop() throws Exception {
+    @Override
+    protected void doStop() throws Exception {
         setTimer(null);
+        super.doStop();
     }
 
     @ManagedAttribute(description = "Timer Name")

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/LimitedPollingConsumerPollStrategy.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/LimitedPollingConsumerPollStrategy.java?rev=1226430&r1=1226429&r2=1226430&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/LimitedPollingConsumerPollStrategy.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/LimitedPollingConsumerPollStrategy.java
Mon Jan  2 14:25:33 2012
@@ -112,6 +112,7 @@ public class LimitedPollingConsumerPollS
     }
 
     public void start() throws Exception {
+        // noop
     }
 
     public void stop() throws Exception {

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/Tracer.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/Tracer.java?rev=1226430&r1=1226429&r2=1226430&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/Tracer.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/Tracer.java
Mon Jan  2 14:25:33 2012
@@ -362,14 +362,16 @@ public class Tracer implements Intercept
         this.traceBodySize = traceBodySize;
     }
 
-    @Override
-    public String toString() {
-        return "Tracer";
-    }
-
     public void start() throws Exception {
+        // noop
     }
 
     public void stop() throws Exception {
+        // noop
+    }
+
+    @Override
+    public String toString() {
+        return "Tracer";
     }
 }



Mime
View raw message