You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2008/12/19 08:58:02 UTC
svn commit: r727967 - in /activemq/camel/trunk/camel-core/src:
main/java/org/apache/camel/model/ test/java/org/apache/camel/processor/
Author: davsclaus
Date: Thu Dec 18 23:58:01 2008
New Revision: 727967
URL: http://svn.apache.org/viewvc?rev=727967&view=rev
Log:
CAMEL-1117: Polished Java DSL
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/MulticastType.java
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/SplitterType.java
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/SplitterTest.java
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/MulticastType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/MulticastType.java?rev=727967&r1=727966&r2=727967&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/MulticastType.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/MulticastType.java Thu Dec 18 23:58:01 2008
@@ -68,9 +68,9 @@
// Fluent API
// -------------------------------------------------------------------------
+
/**
* Set the multicasting aggregationStrategy
- * @param aggregationStrategy
*
* @return the builder
*/
@@ -85,15 +85,15 @@
* @return the builder
*/
public MulticastType parallelProcessing() {
- setParallelProcessing(parallelProcessing);
+ setParallelProcessing(true);
return this;
}
/**
* Set the multicasting action's thread model
- * @param parallelProcessing
- * if it is true the MulticastType will use a thread pool to do the multicasting work;
- * if it is false the MulticastType only do the multicasting work in the calling thread.
+ *
+ * @param parallelProcessing <tt>true</tt> to use a thread pool, if <tt>false</tt> then work is done in the
+ * calling thread.
*
* @return the builder
*/
@@ -104,7 +104,6 @@
/**
* Setting the executor for executing the multicasting action.
- * @param executor
*
* @return the builder
*/
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java?rev=727967&r1=727966&r2=727967&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java Thu Dec 18 23:58:01 2008
@@ -758,13 +758,12 @@
* This splitter responds with the latest message returned from destination
* endpoint.
*
- * @param expression the expression on which to split the message
- * @return the builder
+ * @return the expression clause builder for the expression on which to split
*/
- public SplitterType split(Expression expression) {
- SplitterType answer = new SplitterType(expression);
+ public ExpressionClause<SplitterType> split() {
+ SplitterType answer = new SplitterType();
addOutput(answer);
- return answer;
+ return ExpressionClause.createAndSetExpression(answer);
}
/**
@@ -774,12 +773,13 @@
* This splitter responds with the latest message returned from destination
* endpoint.
*
- * @return the expression clause builder for the expression on which to split
+ * @param expression the expression on which to split the message
+ * @return the builder
*/
- public ExpressionClause<SplitterType> split() {
- SplitterType answer = new SplitterType();
+ public SplitterType split(Expression expression) {
+ SplitterType answer = new SplitterType(expression);
addOutput(answer);
- return ExpressionClause.createAndSetExpression(answer);
+ return answer;
}
/**
@@ -791,7 +791,6 @@
* @param expression the expression on which to split
* @param aggregationStrategy the strategy used to aggregate responses for every part
* @return the builder
- * @deprecated will be removed in Camel 2.0
*/
public SplitterType split(Expression expression, AggregationStrategy aggregationStrategy) {
SplitterType answer = new SplitterType(expression);
@@ -946,6 +945,7 @@
* @param aggregationStrategy the strategy used to aggregate responses for every part
* @param parallelProcessing if is <tt>true</tt> camel will fork thread to call the endpoint producer
* @return the expression clause for the expression on which to split
+ * @deprecated will be removed in Camel 2.0
*/
public ExpressionClause<SplitterType> split(AggregationStrategy aggregationStrategy, boolean parallelProcessing) {
SplitterType answer = new SplitterType();
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/SplitterType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/SplitterType.java?rev=727967&r1=727966&r2=727967&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/SplitterType.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/SplitterType.java Thu Dec 18 23:58:01 2008
@@ -89,16 +89,17 @@
// Fluent API
// -------------------------------------------------------------------------
+
/**
- * Set the expression that the Splitter will use
+ * Set the expression that the splitter will use
+ *
* @return the builder
*/
public ExpressionClause<SplitterType> expression() {
return ExpressionClause.createAndSetExpression(this);
}
/**
- * Set the spliter's aggregationStrategy
- * @param aggregationStrategy
+ * Set the aggregationStrategy
*
* @return the builder
*/
@@ -108,7 +109,7 @@
}
/**
- * Doing the splitting work parallelly
+ * Doing the splitting work in parallel
*
* @return the builder
*/
@@ -119,9 +120,9 @@
/**
* Set the splitting action's thread model
- * @param parallelProcessing
- * if it is true the Splitter will use a thread pool to do the splitting work;
- * if it is false the Splitter only do the splitting work in the calling thread.
+ *
+ * @param parallelProcessing <tt>true</tt> to use a thread pool, if <tt>false</tt> then work is done in the
+ * calling thread.
*
* @return the builder
*/
@@ -143,7 +144,6 @@
/**
* Setting the executor for executing the splitting action.
- * @param executor
*
* @return the builder
*/
Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/SplitterTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/SplitterTest.java?rev=727967&r1=727966&r2=727967&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/SplitterTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/SplitterTest.java Thu Dec 18 23:58:01 2008
@@ -210,7 +210,7 @@
from("direct:seqential").split(body().tokenize(","), new UseLatestAggregationStrategy()).to("mock:result");
from("direct:parallel").split(body().tokenize(","), new MyAggregationStrategy()).parallelProcessing(true).to("mock:result");
from("direct:streaming").split(body().tokenize(",")).streaming().to("mock:result");
- from("direct:parallel-streaming").split(body().tokenize(","), new MyAggregationStrategy(), true).streaming().to("mock:result");
+ from("direct:parallel-streaming").split(body().tokenize(","), new MyAggregationStrategy()).parallelProcessing().streaming().to("mock:result");
from("direct:exception")
.split(body().tokenize(","))
.aggregationStrategy(new MyAggregationStrategy())