camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [06/10] camel git commit: CAMEL-9472: Add multi value to component docs
Date Mon, 04 Jan 2016 14:35:54 GMT
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/f3054406
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f3054406
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f3054406

Branch: refs/heads/camel-2.16.x
Commit: f3054406ffe42bfe6595b0c9eb1f73857ff8e481
Parents: 0749268
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Mon Jan 4 14:18:16 2016 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Mon Jan 4 15:25:01 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/f3054406/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 33dea2a..25651b3 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/f3054406/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 e8bb885..1440abf 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
@@ -60,8 +60,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);
@@ -87,7 +85,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);
@@ -208,23 +216,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;
     }
 
     /**
@@ -241,7 +298,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.");


Mime
View raw message