camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r749559 - in /camel/trunk/components/camel-quartz/src: main/java/org/apache/camel/component/quartz/ test/java/org/apache/camel/component/quartz/
Date Tue, 03 Mar 2009 08:05:48 GMT
Author: davsclaus
Date: Tue Mar  3 08:05:47 2009
New Revision: 749559

URL: http://svn.apache.org/viewvc?rev=749559&view=rev
Log:
Only supports + as space as its the most commonly used, feedback by Hadrian.

Modified:
    camel/trunk/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
    camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzCronRouteTest.java
    camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzEndpointConfigureTest.java

Modified: camel/trunk/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java?rev=749559&r1=749558&r2=749559&view=diff
==============================================================================
--- camel/trunk/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
(original)
+++ camel/trunk/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
Tue Mar  3 08:05:47 2009
@@ -99,12 +99,10 @@
     }
 
     protected CronTrigger createCronTrigger(String path) throws ParseException {
-        // replace _ back to space so its a cron expression
-        String s = path.replaceAll("_", " ");
         // replace + back to space so its a cron expression
-        s = s.replaceAll("\\+", " ");
+        path = path.replaceAll("\\+", " ");
         CronTrigger cron = new CronTrigger();
-        cron.setCronExpression(s);
+        cron.setCronExpression(path);
         return cron;
     }
 
@@ -114,14 +112,18 @@
         if (scheduler == null) {
             scheduler = getScheduler();
         }
-        LOG.debug("Starting Quartz scheduler: " + scheduler.getSchedulerName());
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Starting Quartz scheduler: " + scheduler.getSchedulerName());
+        }
         scheduler.start();
     }
 
     @Override
     protected void doStop() throws Exception {
         if (scheduler != null) {
-            LOG.debug("Shutting down Quartz scheduler: " + scheduler.getSchedulerName());
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Shutting down Quartz scheduler: " + scheduler.getSchedulerName());
+            }
             scheduler.shutdown();
         }
         super.doStop();
@@ -151,11 +153,11 @@
         this.scheduler = scheduler;
     }
 
-    public Map getTriggers() {
+    public Map<Trigger, JobDetail> getTriggers() {
         return triggers;
     }
 
-    public void setTriggers(final Map triggers) {
+    public void setTriggers(final Map<Trigger, JobDetail> triggers) {
         this.triggers = triggers;
     }
 

Modified: camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzCronRouteTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzCronRouteTest.java?rev=749559&r1=749558&r2=749559&view=diff
==============================================================================
--- camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzCronRouteTest.java
(original)
+++ camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzCronRouteTest.java
Tue Mar  3 08:05:47 2009
@@ -38,8 +38,8 @@
             public void configure() {
                 // START SNIPPET: e1
                 // triggers every 2th second at precise 00,02,04,06..58
-                // notice we must use _ as space when configurd using URI parameter
-                from("quartz://myGroup/myTimerName?cron=0/2_*_*_*_*_?").to("mock:result");
+                // notice we must use + as space when configurd using URI parameter
+                from("quartz://myGroup/myTimerName?cron=0/2+*+*+*+*+?").to("mock:result");
                 // END SNIPPET: e1
             }
         };

Modified: camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzEndpointConfigureTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzEndpointConfigureTest.java?rev=749559&r1=749558&r2=749559&view=diff
==============================================================================
--- camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzEndpointConfigureTest.java
(original)
+++ camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzEndpointConfigureTest.java
Tue Mar  3 08:05:47 2009
@@ -46,7 +46,7 @@
     }
 
     public void testConfigureCronExpression() throws Exception {
-        QuartzEndpoint endpoint = resolveMandatoryEndpoint("quartz://myGroup/myTimerName?cron=0_0/5_12-18_?_*_MON-FRI");
+        QuartzEndpoint endpoint = resolveMandatoryEndpoint("quartz://myGroup/myTimerName?cron=0+0/5+12-18+?+*+MON-FRI");
         CronTrigger trigger = assertIsInstanceOf(CronTrigger.class, endpoint.getTrigger());
         assertEquals("getName()", "myTimerName", trigger.getName());
         assertEquals("getGroup()", "myGroup", trigger.getGroup());
@@ -54,7 +54,7 @@
     }
 
     public void testConfigureAnotherCronExpression() throws Exception {
-        QuartzEndpoint endpoint = resolveMandatoryEndpoint("quartz://myGroup/myTimerName?cron=0_0_*_*_*_?");
+        QuartzEndpoint endpoint = resolveMandatoryEndpoint("quartz://myGroup/myTimerName?cron=0+0+*+*+*+?");
         CronTrigger trigger = assertIsInstanceOf(CronTrigger.class, endpoint.getTrigger());
         assertEquals("getName()", "myTimerName", trigger.getName());
         assertEquals("getGroup()", "myGroup", trigger.getGroup());



Mime
View raw message