camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r957395 - /camel/trunk/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
Date Thu, 24 Jun 2010 00:51:15 GMT
Author: ningjiang
Date: Thu Jun 24 00:51:15 2010
New Revision: 957395

URL: http://svn.apache.org/viewvc?rev=957395&view=rev
Log:
CAMEL-2788 camel-quartz - Allow to specify job as volatile and other improvements by applying
patch with thanks to Ingo

Modified:
    camel/trunk/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.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=957395&r1=957394&r2=957395&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
Thu Jun 24 00:51:15 2010
@@ -144,10 +144,18 @@ public class QuartzComponent extends Def
     public void addJob(JobDetail job, Trigger trigger) throws SchedulerException {
         JOBS.incrementAndGet();
 
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("Adding job using trigger: " + trigger.getGroup() + "/" + trigger.getName());
+        if (getScheduler().getTrigger(trigger.getName(), trigger.getGroup()) == null) {
+        	if (LOG.isDebugEnabled()) {
+        		LOG.debug("Adding job using trigger: " + trigger.getGroup() + "/" + trigger.getName());
+        	}
+        	getScheduler().scheduleJob(job, trigger);
+        } else {
+        	if (LOG.isDebugEnabled()) {
+        		LOG.debug("Resuming job using trigger: " + trigger.getGroup() + "/" + trigger.getName());
+        	}
+        	getScheduler().resumeTrigger(trigger.getName(), trigger.getGroup());
         }
-        getScheduler().scheduleJob(job, trigger);
+        
     }
 
     public void removeJob(Trigger trigger) throws SchedulerException {



Mime
View raw message