Component docs
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/06eae5ee Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/06eae5ee Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/06eae5ee Branch: refs/heads/master Commit: 06eae5ee424d8de4a0043df946393c96bdccf041 Parents: ba9bd8c Author: Claus Ibsen <davscl...@apache.org> Authored: Thu May 7 14:10:05 2015 +0200 Committer: Claus Ibsen <davscl...@apache.org> Committed: Thu May 7 14:31:54 2015 +0200 ---------------------------------------------------------------------- .../camel/component/quartz/QuartzComponent.java | 24 +++++++++++++- .../camel/component/quartz/QuartzEndpoint.java | 35 ++++++++++++++++---- 2 files changed, 52 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/06eae5ee/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java ---------------------------------------------------------------------- diff --git a/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java b/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java index edf27a8..6fdde5b 100644 --- a/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java +++ b/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java @@ -53,7 +53,7 @@ import org.slf4j.LoggerFactory; public class QuartzComponent extends UriEndpointComponent implements StartupListener { private static final Logger LOG = LoggerFactory.getLogger(QuartzComponent.class); private Scheduler scheduler; - private final List<JobToAdd> jobsToAdd = new ArrayList<JobToAdd>(); + private transient final List<JobToAdd> jobsToAdd = new ArrayList<JobToAdd>(); private SchedulerFactory factory; private Properties properties; private String propertiesFile; @@ -409,6 +409,9 @@ public class QuartzComponent extends UriEndpointComponent implements StartupList return scheduler; } + /** + * To use the custom configured Quartz scheduler, instead of creating a new Scheduler. + */ public void setScheduler(final Scheduler scheduler) { this.scheduler = scheduler; } @@ -417,6 +420,9 @@ public class QuartzComponent extends UriEndpointComponent implements StartupList return properties; } + /** + * Properties to configure the Quartz scheduler. + */ public void setProperties(Properties properties) { this.properties = properties; } @@ -425,6 +431,9 @@ public class QuartzComponent extends UriEndpointComponent implements StartupList return propertiesFile; } + /** + * File name of the properties to load from the classpath + */ public void setPropertiesFile(String propertiesFile) { this.propertiesFile = propertiesFile; } @@ -433,6 +442,9 @@ public class QuartzComponent extends UriEndpointComponent implements StartupList return startDelayedSeconds; } + /** + * Seconds to wait before starting the quartz scheduler. + */ public void setStartDelayedSeconds(int startDelayedSeconds) { this.startDelayedSeconds = startDelayedSeconds; } @@ -441,6 +453,11 @@ public class QuartzComponent extends UriEndpointComponent implements StartupList return autoStartScheduler; } + /** + * Whether or not the scheduler should be auto started. + * <p/> + * This options is default true + */ public void setAutoStartScheduler(boolean autoStartScheduler) { this.autoStartScheduler = autoStartScheduler; } @@ -449,6 +466,11 @@ public class QuartzComponent extends UriEndpointComponent implements StartupList return enableJmx; } + /** + * Whether to enable Quartz JMX which allows to manage the Quartz scheduler from JMX. + * <p/> + * This options is default true + */ public void setEnableJmx(boolean enableJmx) { this.enableJmx = enableJmx; } http://git-wip-us.apache.org/repos/asf/camel/blob/06eae5ee/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzEndpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzEndpoint.java b/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzEndpoint.java index b222203..51721e5 100644 --- a/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzEndpoint.java +++ b/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzEndpoint.java @@ -54,6 +54,7 @@ public class QuartzEndpoint extends DefaultEndpoint implements ShutdownableServi private Trigger trigger; private JobDetail jobDetail = new JobDetail(); private volatile boolean started; + @UriPath(defaultValue = "Camel") private String groupName; @UriPath @Metadata(required = "true") @@ -64,9 +65,6 @@ public class QuartzEndpoint extends DefaultEndpoint implements ShutdownableServi private boolean deleteJob = true; @UriParam private boolean pauseJob; - /** If it is true, the CamelContext name is used, - * if it is false, use the CamelContext management name which could be changed during the deploy time - **/ @UriParam private boolean usingFixedCamelContextName; @@ -196,6 +194,9 @@ public class QuartzEndpoint extends DefaultEndpoint implements ShutdownableServi return groupName; } + /** + * The quartz group name to use. The combination of group name and timer name should be unique. + */ public void setGroupName(String groupName) { this.groupName = groupName; } @@ -204,6 +205,9 @@ public class QuartzEndpoint extends DefaultEndpoint implements ShutdownableServi return timerName; } + /** + * The quartz timer name to use. The combination of group name and timer name should be unique. + */ public void setTimerName(String timerName) { this.timerName = timerName; } @@ -232,6 +236,9 @@ public class QuartzEndpoint extends DefaultEndpoint implements ShutdownableServi return this.stateful; } + /** + * Uses a Quartz StatefulJob instead of the default job. + */ public void setStateful(final boolean stateful) { this.stateful = stateful; } @@ -240,6 +247,12 @@ public class QuartzEndpoint extends DefaultEndpoint implements ShutdownableServi return deleteJob; } + /** + * If set to true, then the trigger automatically delete when route stop. + * Else if set to false, it will remain in scheduler. When set to false, it will also mean user may reuse + * pre-configured trigger with camel Uri. Just ensure the names match. + * Notice you cannot have both deleteJob and pauseJob set to true. + */ public void setDeleteJob(boolean deleteJob) { this.deleteJob = deleteJob; } @@ -248,21 +261,31 @@ public class QuartzEndpoint extends DefaultEndpoint implements ShutdownableServi return pauseJob; } + /** + * If set to true, then the trigger automatically pauses when route stop. + * Else if set to false, it will remain in scheduler. When set to false, it will also mean user may reuse + * pre-configured trigger with camel Uri. Just ensure the names match. + * Notice you cannot have both deleteJob and pauseJob set to true. + */ public void setPauseJob(boolean pauseJob) { this.pauseJob = pauseJob; } - // Implementation methods - // ------------------------------------------------------------------------- - public boolean isUsingFixedCamelContextName() { return usingFixedCamelContextName; } + /** + * If it is true, JobDataMap uses the CamelContext name directly to reference the CamelContext, + * if it is false, JobDataMap uses use the CamelContext management name which could be changed during the deploy time. + */ public void setUsingFixedCamelContextName(boolean usingFixedCamelContextName) { this.usingFixedCamelContextName = usingFixedCamelContextName; } + // Implementation methods + // ------------------------------------------------------------------------- + public synchronized void consumerStarted(final QuartzConsumer consumer) throws SchedulerException { ObjectHelper.notNull(trigger, "trigger"); LOG.debug("Adding consumer {}", consumer.getProcessor());