CAMEL-9472: Add multi value to component docs
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/8c80d808 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/8c80d808 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/8c80d808 Branch: refs/heads/master Commit: 8c80d8083ad2241d18662e7c29dbee978fa84e01 Parents: df2b8c7 Author: Claus Ibsen <davscl...@apache.org> Authored: Mon Jan 4 14:18:16 2016 +0100 Committer: Claus Ibsen <davscl...@apache.org> Committed: Mon Jan 4 15:24:18 2016 +0100 ---------------------------------------------------------------------- .../component/quartz2/QuartzComponent.java | 9 +++ .../camel/component/quartz2/QuartzEndpoint.java | 77 +++++++++++++++++--- 2 files changed, 76 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/8c80d808/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java ---------------------------------------------------------------------- diff --git a/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java b/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java index 993166c..628adc9 100644 --- a/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java +++ b/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java @@ -321,6 +321,15 @@ public class QuartzComponent extends UriEndpointComponent implements StartupList result.setTriggerKey(triggerKey); result.setTriggerParameters(triggerParameters); result.setJobParameters(jobParameters); + if (startDelayedSeconds != null) { + result.setStartDelayedSeconds(startDelayedSeconds); + } + if (autoStartScheduler != null) { + result.setAutoStartScheduler(autoStartScheduler); + } + if (prefixJobNameWithEndpointId != null) { + result.setPrefixJobNameWithEndpointId(prefixJobNameWithEndpointId); + } return result; } http://git-wip-us.apache.org/repos/asf/camel/blob/8c80d808/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzEndpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzEndpoint.java b/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzEndpoint.java index 2792c43..6bd8fb2 100644 --- a/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzEndpoint.java +++ b/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzEndpoint.java @@ -58,8 +58,6 @@ public class QuartzEndpoint extends DefaultEndpoint { private static final Logger LOG = LoggerFactory.getLogger(QuartzEndpoint.class); private TriggerKey triggerKey; private LoadBalancer consumerLoadBalancer; - private Map<String, Object> triggerParameters; - private Map<String, Object> jobParameters; // An internal variables to track whether a job has been in scheduler or not, and has it paused or not. private final AtomicBoolean jobAdded = new AtomicBoolean(false); private final AtomicBoolean jobPaused = new AtomicBoolean(false); @@ -85,7 +83,17 @@ public class QuartzEndpoint extends DefaultEndpoint { @UriParam(defaultValue = "500") private long triggerStartDelay = 500; @UriParam + private int startDelayedSeconds; + @UriParam(defaultValue = "true") + private boolean autoStartScheduler = true; + @UriParam private boolean usingFixedCamelContextName; + @UriParam + private boolean prefixJobNameWithEndpointId; + @UriParam(prefix = "trigger.", multiValue = true) + private Map<String, Object> triggerParameters; + @UriParam(prefix = "job.", multiValue = true) + private Map<String, Object> jobParameters; public QuartzEndpoint(String uri, QuartzComponent quartzComponent) { super(uri, quartzComponent); @@ -206,23 +214,72 @@ public class QuartzEndpoint extends DefaultEndpoint { this.usingFixedCamelContextName = usingFixedCamelContextName; } + public LoadBalancer getConsumerLoadBalancer() { + if (consumerLoadBalancer == null) { + consumerLoadBalancer = new RoundRobinLoadBalancer(); + } + return consumerLoadBalancer; + } + + public void setConsumerLoadBalancer(LoadBalancer consumerLoadBalancer) { + this.consumerLoadBalancer = consumerLoadBalancer; + } + + + public Map<String, Object> getTriggerParameters() { + return triggerParameters; + } + + /** + * To configure additional options on the trigger. + */ public void setTriggerParameters(Map<String, Object> triggerParameters) { this.triggerParameters = triggerParameters; } + public Map<String, Object> getJobParameters() { + return jobParameters; + } + + /** + * To configure additional options on the job. + */ public void setJobParameters(Map<String, Object> jobParameters) { this.jobParameters = jobParameters; } - public LoadBalancer getConsumerLoadBalancer() { - if (consumerLoadBalancer == null) { - consumerLoadBalancer = new RoundRobinLoadBalancer(); - } - return consumerLoadBalancer; + public int getStartDelayedSeconds() { + return startDelayedSeconds; } - public void setConsumerLoadBalancer(LoadBalancer consumerLoadBalancer) { - this.consumerLoadBalancer = consumerLoadBalancer; + /** + * Seconds to wait before starting the quartz scheduler. + */ + public void setStartDelayedSeconds(int startDelayedSeconds) { + this.startDelayedSeconds = startDelayedSeconds; + } + + public boolean isAutoStartScheduler() { + return autoStartScheduler; + } + + /** + * Whether or not the scheduler should be auto started. + */ + public void setAutoStartScheduler(boolean autoStartScheduler) { + this.autoStartScheduler = autoStartScheduler; + } + + public boolean isPrefixJobNameWithEndpointId() { + return prefixJobNameWithEndpointId; + } + + /** + * Whether the job name should be prefixed with endpoint id + * @param prefixJobNameWithEndpointId + */ + public void setPrefixJobNameWithEndpointId(boolean prefixJobNameWithEndpointId) { + this.prefixJobNameWithEndpointId = prefixJobNameWithEndpointId; } /** @@ -239,7 +296,7 @@ public class QuartzEndpoint extends DefaultEndpoint { public void setTriggerKey(TriggerKey triggerKey) { this.triggerKey = triggerKey; } - + @Override public Producer createProducer() throws Exception { throw new UnsupportedOperationException("Quartz producer is not supported.");