camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject camel git commit: CAMEL-7999: apt compiler to generate json schema documentation for the model, whcih we later use to enrich the xml xsd to include documentation. Work in progress.
Date Tue, 30 Dec 2014 17:08:34 GMT
Repository: camel
Updated Branches:
  refs/heads/master c230ccef8 -> 6e1493792


CAMEL-7999: apt compiler to generate json schema documentation for the model, whcih we later
use to enrich the xml xsd to include documentation. Work in progress.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/6e149379
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/6e149379
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/6e149379

Branch: refs/heads/master
Commit: 6e14937922a2bfbbed0a8c1b8c110e33065c2c1f
Parents: c230cce
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Tue Dec 30 15:12:24 2014 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Tue Dec 30 15:12:24 2014 +0100

----------------------------------------------------------------------
 .../model/config/BatchResequencerConfig.java    | 18 ++++++++++++--
 .../model/config/StreamResequencerConfig.java   | 26 ++++++++++++++++----
 .../ModelDocumentationAnnotationProcessor.java  |  9 +++++++
 3 files changed, 46 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/6e149379/camel-core/src/main/java/org/apache/camel/model/config/BatchResequencerConfig.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/config/BatchResequencerConfig.java
b/camel-core/src/main/java/org/apache/camel/model/config/BatchResequencerConfig.java
index f5f06f8..e9d227e 100644
--- a/camel-core/src/main/java/org/apache/camel/model/config/BatchResequencerConfig.java
+++ b/camel-core/src/main/java/org/apache/camel/model/config/BatchResequencerConfig.java
@@ -22,8 +22,7 @@ import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlRootElement;
 
 /**
- * Defines the configuration parameters for the batch-processing
- * {@link org.apache.camel.processor.Resequencer}. Usage example:
+ * Configures batch-processing resequence eip.
  */
 @XmlRootElement(name = "batch-config")
 @XmlAccessorType(XmlAccessType.FIELD)
@@ -75,6 +74,9 @@ public class BatchResequencerConfig extends ResequencerConfig {
         return batchSize;
     }
 
+    /**
+     * Sets the size of the batch to be re-ordered. The default size is 100.
+     */
     public void setBatchSize(int batchSize) {
         this.batchSize = batchSize;
     }
@@ -83,6 +85,9 @@ public class BatchResequencerConfig extends ResequencerConfig {
         return batchTimeout;
     }
 
+    /**
+     * Sets the timeout for collecting elements to be re-ordered. The default timeout is
1000 msec.
+     */
     public void setBatchTimeout(long batchTimeout) {
         this.batchTimeout = batchTimeout;
     }
@@ -95,6 +100,9 @@ public class BatchResequencerConfig extends ResequencerConfig {
         return allowDuplicates;
     }
 
+    /**
+     * Whether to allow duplicates.
+     */
     public void setAllowDuplicates(Boolean allowDuplicates) {
         this.allowDuplicates = allowDuplicates;
     }
@@ -107,6 +115,9 @@ public class BatchResequencerConfig extends ResequencerConfig {
         return reverse;
     }
 
+    /**
+     * Whether to reverse the ordering.
+     */
     public void setReverse(Boolean reverse) {
         this.reverse = reverse;
     }
@@ -115,6 +126,9 @@ public class BatchResequencerConfig extends ResequencerConfig {
         return ignoreInvalidExchanges;
     }
 
+    /**
+     * Whether to ignore invalid exchanges
+     */
     public void setIgnoreInvalidExchanges(Boolean ignoreInvalidExchanges) {
         this.ignoreInvalidExchanges = ignoreInvalidExchanges;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/6e149379/camel-core/src/main/java/org/apache/camel/model/config/StreamResequencerConfig.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/config/StreamResequencerConfig.java
b/camel-core/src/main/java/org/apache/camel/model/config/StreamResequencerConfig.java
index 7c6854a..56333b8 100644
--- a/camel-core/src/main/java/org/apache/camel/model/config/StreamResequencerConfig.java
+++ b/camel-core/src/main/java/org/apache/camel/model/config/StreamResequencerConfig.java
@@ -26,9 +26,7 @@ import org.apache.camel.processor.resequencer.DefaultExchangeComparator;
 import org.apache.camel.processor.resequencer.ExpressionResultComparator;
 
 /**
- * Defines the configuration parameters for the {@link org.apache.camel.processor.StreamResequencer}.
- *
- * @version 
+ * Configures stream-processing resequence eip.
  */
 @XmlRootElement(name = "stream-config")
 @XmlAccessorType(XmlAccessType.FIELD)
@@ -91,7 +89,7 @@ public class StreamResequencerConfig extends ResequencerConfig {
      *
      * @param capacity   capacity of the resequencer's inbound queue.
      * @param timeout    minimum time to wait for missing elements (messages).
-     * @param rejectOld  if true, throws an error when messages older than the last delivered
message are processed
+     * @param rejectOld  if true, throws an exception when messages older than the last delivered
message are processed
      */
     public StreamResequencerConfig(int capacity, long timeout, Boolean rejectOld) {
         this(capacity, timeout, rejectOld, new DefaultExchangeComparator());
@@ -104,7 +102,7 @@ public class StreamResequencerConfig extends ResequencerConfig {
      *
      * @param capacity   capacity of the resequencer's inbound queue.
      * @param timeout    minimum time to wait for missing elements (messages).
-     * @param rejectOld  if true, throws an error when messages older than the last delivered
message are processed
+     * @param rejectOld  if true, throws an exception when messages older than the last delivered
message are processed
      * @param comparator comparator for sequence comparision
      */
     public StreamResequencerConfig(int capacity, long timeout, Boolean rejectOld, ExpressionResultComparator
comparator) {
@@ -130,6 +128,9 @@ public class StreamResequencerConfig extends ResequencerConfig {
         return capacity;
     }
 
+    /**
+     * Sets the capacity of the resequencer's inbound queue.
+     */
     public void setCapacity(int capacity) {
         this.capacity = capacity;
     }
@@ -138,6 +139,9 @@ public class StreamResequencerConfig extends ResequencerConfig {
         return timeout;
     }
 
+    /**
+     * Sets minimum time to wait for missing elements (messages).
+     */
     public void setTimeout(long timeout) {
         this.timeout = timeout;
     }
@@ -146,6 +150,9 @@ public class StreamResequencerConfig extends ResequencerConfig {
         return ignoreInvalidExchanges;
     }
 
+    /**
+     * Whether to ignore invalid exchanges
+     */
     public void setIgnoreInvalidExchanges(Boolean ignoreInvalidExchanges) {
         this.ignoreInvalidExchanges = ignoreInvalidExchanges;
     }
@@ -154,6 +161,9 @@ public class StreamResequencerConfig extends ResequencerConfig {
         return comparator;
     }
 
+    /**
+     * To use a custom comparator
+     */
     public void setComparator(ExpressionResultComparator comparator) {
         this.comparator = comparator;
     }
@@ -162,10 +172,16 @@ public class StreamResequencerConfig extends ResequencerConfig {
         return comparatorRef;
     }
 
+    /**
+     * To use a custom comparator
+     */
     public void setComparatorRef(String comparatorRef) {
         this.comparatorRef = comparatorRef;
     }
 
+    /**
+     * If true, throws an exception when messages older than the last delivered message are
processed
+     */
     public void setRejectOld(boolean value) {
         this.rejectOld = value;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/6e149379/tooling/apt/src/main/java/org/apache/camel/tools/apt/ModelDocumentationAnnotationProcessor.java
----------------------------------------------------------------------
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/ModelDocumentationAnnotationProcessor.java
b/tooling/apt/src/main/java/org/apache/camel/tools/apt/ModelDocumentationAnnotationProcessor.java
index 8490a4d..7015061 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/ModelDocumentationAnnotationProcessor.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/ModelDocumentationAnnotationProcessor.java
@@ -46,6 +46,15 @@ import static org.apache.camel.tools.apt.Strings.canonicalClassName;
 import static org.apache.camel.tools.apt.Strings.isNullOrEmpty;
 import static org.apache.camel.tools.apt.Strings.safeNull;
 
+// TODO: figure out a way to specify default value in the model classes which this APT can
read
+
+// TODO: add support for @XmlElements which a few EIPs uses such as resequence
+//@XmlElements({
+//        @XmlElement(name = "batch-config", type = BatchResequencerConfig.class),
+//        @XmlElement(name = "stream-config", type = StreamResequencerConfig.class)}
+//)
+
+
 /**
  * Process all camel-core's model classes (EIPs and DSL) and generate json schema documentation
  */


Mime
View raw message