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/02/18 06:47:39 UTC

[2/2] git commit: CAMEL-7215 moved the onRemove method to ScheduledRoutePolicy

CAMEL-7215 moved the onRemove method to ScheduledRoutePolicy


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

Branch: refs/heads/camel-2.12.x
Commit: 887f7c39ad63884ea6f11897c7e7a3ce165784a3
Parents: 35a9742
Author: Willem Jiang <wi...@gmail.com>
Authored: Tue Feb 18 13:22:19 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Tue Feb 18 13:46:37 2014 +0800

----------------------------------------------------------------------
 .../routepolicy/quartz/CronScheduledRoutePolicy.java    | 11 +----------
 .../camel/routepolicy/quartz/ScheduledRoutePolicy.java  | 11 +++++++++++
 .../routepolicy/quartz/SimpleScheduledRoutePolicy.java  | 12 +-----------
 .../routepolicy/quartz2/CronScheduledRoutePolicy.java   |  9 ---------
 .../camel/routepolicy/quartz2/ScheduledRoutePolicy.java | 11 +++++++++++
 .../routepolicy/quartz2/SimpleScheduledRoutePolicy.java | 10 ----------
 6 files changed, 24 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/887f7c39/components/camel-quartz/src/main/java/org/apache/camel/routepolicy/quartz/CronScheduledRoutePolicy.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/main/java/org/apache/camel/routepolicy/quartz/CronScheduledRoutePolicy.java b/components/camel-quartz/src/main/java/org/apache/camel/routepolicy/quartz/CronScheduledRoutePolicy.java
index 1c21f49..32161d8 100644
--- a/components/camel-quartz/src/main/java/org/apache/camel/routepolicy/quartz/CronScheduledRoutePolicy.java
+++ b/components/camel-quartz/src/main/java/org/apache/camel/routepolicy/quartz/CronScheduledRoutePolicy.java
@@ -73,16 +73,7 @@ public class CronScheduledRoutePolicy extends ScheduledRoutePolicy implements Sc
             scheduleRoute(Action.RESUME, route);
         }
     }
-
-    public void onRemove(Route route) {
-        try {
-            // stop and un-schedule jobs
-            doStop();
-        } catch (Exception e) {
-            throw ObjectHelper.wrapRuntimeCamelException(e);
-        }
-    }
-
+    
     @Override
     protected Trigger createTrigger(Action action, Route route) throws Exception {
         CronTrigger trigger = null;

http://git-wip-us.apache.org/repos/asf/camel/blob/887f7c39/components/camel-quartz/src/main/java/org/apache/camel/routepolicy/quartz/ScheduledRoutePolicy.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/main/java/org/apache/camel/routepolicy/quartz/ScheduledRoutePolicy.java b/components/camel-quartz/src/main/java/org/apache/camel/routepolicy/quartz/ScheduledRoutePolicy.java
index a22e397..b355413 100644
--- a/components/camel-quartz/src/main/java/org/apache/camel/routepolicy/quartz/ScheduledRoutePolicy.java
+++ b/components/camel-quartz/src/main/java/org/apache/camel/routepolicy/quartz/ScheduledRoutePolicy.java
@@ -24,6 +24,7 @@ import org.apache.camel.Route;
 import org.apache.camel.ServiceStatus;
 import org.apache.camel.component.quartz.QuartzComponent;
 import org.apache.camel.impl.RoutePolicySupport;
+import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.util.ServiceHelper;
 import org.quartz.JobDetail;
 import org.quartz.Scheduler;
@@ -76,6 +77,16 @@ public abstract class ScheduledRoutePolicy extends RoutePolicySupport implements
             }
         }       
     }
+    
+    @Override
+    public void onRemove(Route route) {
+        try {
+            // stop and un-schedule jobs
+            doStop();
+        } catch (Exception e) {
+            throw ObjectHelper.wrapRuntimeCamelException(e);
+        }
+    }
 
     public void scheduleRoute(Action action, Route route) throws Exception {
         JobDetail jobDetail = createJobDetail(action, route);

http://git-wip-us.apache.org/repos/asf/camel/blob/887f7c39/components/camel-quartz/src/main/java/org/apache/camel/routepolicy/quartz/SimpleScheduledRoutePolicy.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/main/java/org/apache/camel/routepolicy/quartz/SimpleScheduledRoutePolicy.java b/components/camel-quartz/src/main/java/org/apache/camel/routepolicy/quartz/SimpleScheduledRoutePolicy.java
index 5f6be14..5b29f9b 100644
--- a/components/camel-quartz/src/main/java/org/apache/camel/routepolicy/quartz/SimpleScheduledRoutePolicy.java
+++ b/components/camel-quartz/src/main/java/org/apache/camel/routepolicy/quartz/SimpleScheduledRoutePolicy.java
@@ -103,17 +103,7 @@ public class SimpleScheduledRoutePolicy extends ScheduledRoutePolicy {
         
         return trigger;
     }
-
-    @Override
-    public void onRemove(Route route) {
-        try {
-            // stop and un-schedule jobs
-            doStop();
-        } catch (Exception e) {
-            throw ObjectHelper.wrapRuntimeCamelException(e);
-        }
-    }
-
+    
     public Date getRouteStartDate() {
         return routeStartDate;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/887f7c39/components/camel-quartz2/src/main/java/org/apache/camel/routepolicy/quartz2/CronScheduledRoutePolicy.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/main/java/org/apache/camel/routepolicy/quartz2/CronScheduledRoutePolicy.java b/components/camel-quartz2/src/main/java/org/apache/camel/routepolicy/quartz2/CronScheduledRoutePolicy.java
index 205f113..2271628 100644
--- a/components/camel-quartz2/src/main/java/org/apache/camel/routepolicy/quartz2/CronScheduledRoutePolicy.java
+++ b/components/camel-quartz2/src/main/java/org/apache/camel/routepolicy/quartz2/CronScheduledRoutePolicy.java
@@ -76,15 +76,6 @@ public class CronScheduledRoutePolicy extends ScheduledRoutePolicy implements Sc
         }
     }
 
-    public void onRemove(Route route) {
-        try {
-            // stop and un-schedule jobs
-            doStop();
-        } catch (Exception e) {
-            throw ObjectHelper.wrapRuntimeCamelException(e);
-        }
-    }
-
     @Override
     protected Trigger createTrigger(Action action, Route route) throws Exception {
         CronTrigger trigger = null;

http://git-wip-us.apache.org/repos/asf/camel/blob/887f7c39/components/camel-quartz2/src/main/java/org/apache/camel/routepolicy/quartz2/ScheduledRoutePolicy.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/main/java/org/apache/camel/routepolicy/quartz2/ScheduledRoutePolicy.java b/components/camel-quartz2/src/main/java/org/apache/camel/routepolicy/quartz2/ScheduledRoutePolicy.java
index df42873..eaeaeee 100644
--- a/components/camel-quartz2/src/main/java/org/apache/camel/routepolicy/quartz2/ScheduledRoutePolicy.java
+++ b/components/camel-quartz2/src/main/java/org/apache/camel/routepolicy/quartz2/ScheduledRoutePolicy.java
@@ -24,6 +24,7 @@ import org.apache.camel.Route;
 import org.apache.camel.ServiceStatus;
 import org.apache.camel.component.quartz2.QuartzComponent;
 import org.apache.camel.impl.RoutePolicySupport;
+import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.util.ServiceHelper;
 import org.quartz.JobBuilder;
 import org.quartz.JobDetail;
@@ -90,6 +91,16 @@ public abstract class ScheduledRoutePolicy extends RoutePolicySupport implements
             }
         }       
     }
+    
+    @Override
+    public void onRemove(Route route) {
+        try {
+            // stop and un-schedule jobs
+            doStop();
+        } catch (Exception e) {
+            throw ObjectHelper.wrapRuntimeCamelException(e);
+        }
+    }
 
     public void scheduleRoute(Action action, Route route) throws Exception {
         JobDetail jobDetail = createJobDetail(action, route);

http://git-wip-us.apache.org/repos/asf/camel/blob/887f7c39/components/camel-quartz2/src/main/java/org/apache/camel/routepolicy/quartz2/SimpleScheduledRoutePolicy.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/main/java/org/apache/camel/routepolicy/quartz2/SimpleScheduledRoutePolicy.java b/components/camel-quartz2/src/main/java/org/apache/camel/routepolicy/quartz2/SimpleScheduledRoutePolicy.java
index cda294b..95f135e 100644
--- a/components/camel-quartz2/src/main/java/org/apache/camel/routepolicy/quartz2/SimpleScheduledRoutePolicy.java
+++ b/components/camel-quartz2/src/main/java/org/apache/camel/routepolicy/quartz2/SimpleScheduledRoutePolicy.java
@@ -126,16 +126,6 @@ public class SimpleScheduledRoutePolicy extends ScheduledRoutePolicy {
         return trigger;
     }
 
-    @Override
-    public void onRemove(Route route) {
-        try {
-            // stop and un-schedule jobs
-            doStop();
-        } catch (Exception e) {
-            throw ObjectHelper.wrapRuntimeCamelException(e);
-        }
-    }
-
     public Date getRouteStartDate() {
         return routeStartDate;
     }