camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1034337 - /camel/trunk/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
Date Fri, 12 Nov 2010 10:19:56 GMT
Author: davsclaus
Date: Fri Nov 12 10:19:55 2010
New Revision: 1034337

URL: http://svn.apache.org/viewvc?rev=1034337&view=rev
Log:
CAMEL-3336: Added support for older versions of quartz. Thanks to Savas for patch.

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=1034337&r1=1034336&r2=1034337&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
Fri Nov 12 10:19:55 2010
@@ -275,7 +275,12 @@ public class QuartzComponent extends Def
      * Is the quartz scheduler clustered?
      */
     public boolean isClustered() throws SchedulerException {
-        return getScheduler().getMetaData().isJobStoreClustered();
+        try {
+            return getScheduler().getMetaData().isJobStoreClustered();
+        } catch (NoSuchMethodError e) {
+            LOG.debug("Job clustering is only supported since Quartz 1.7, isClustered returning
false");
+            return false;
+        }
     }
 
     /**
@@ -292,7 +297,13 @@ public class QuartzComponent extends Def
         if (!getScheduler().isStarted()) {
             if (getStartDelayedSeconds() > 0) {
                 LOG.info("Starting Quartz scheduler: " + getScheduler().getSchedulerName()
+ " delayed: " + getStartDelayedSeconds() + " seconds.");
-                getScheduler().startDelayed(getStartDelayedSeconds());
+                try {
+                    getScheduler().startDelayed(getStartDelayedSeconds());
+                } catch (NoSuchMethodError e) {
+                    LOG.warn("Your version of Quartz is too old to support delayed startup!
"
+                        + "Starting Quartz scheduler immediately : " + getScheduler().getSchedulerName());
+                    getScheduler().start();
+                }
             } else {
                 LOG.info("Starting Quartz scheduler: " + getScheduler().getSchedulerName());
                 getScheduler().start();



Mime
View raw message