You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by js...@apache.org on 2007/09/26 14:44:47 UTC
svn commit: r579646 -
/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/AggregatorType.java
Author: jstrachan
Date: Wed Sep 26 05:44:47 2007
New Revision: 579646
URL: http://svn.apache.org/viewvc?rev=579646&view=rev
Log:
applied patch from https://issues.apache.org/activemq/browse/CAMEL-155 by Nicky Sandhu to expose more aggregator properties in the DSL
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/AggregatorType.java
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/AggregatorType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/AggregatorType.java?rev=579646&r1=579645&r2=579646&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/AggregatorType.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/AggregatorType.java Wed Sep 26 05:44:47 2007
@@ -42,7 +42,8 @@
public class AggregatorType extends ExpressionNode {
@XmlTransient
private AggregationStrategy aggregationStrategy = new UseLatestAggregationStrategy();
-
+ private int batchSize;
+ private long batchTimeout;
public AggregatorType() {
}
@@ -70,6 +71,8 @@
final Processor processor = routeContext.createProcessor(this);
final Aggregator service = new Aggregator(from, processor, getExpression()
.createExpression(routeContext), aggregationStrategy);
+ service.setBatchSize(batchSize);
+ service.setBatchTimeout(batchTimeout);
Route route = new Route<Exchange>(from, service) {
@Override
@@ -87,5 +90,33 @@
public void setAggregationStrategy(AggregationStrategy aggregationStrategy) {
this.aggregationStrategy = aggregationStrategy;
+ }
+
+ public int getBatchSize() {
+ return batchSize;
+ }
+
+ public void setBatchSize(int batchSize) {
+ this.batchSize = batchSize;
+ }
+
+ public long getBatchTimeout() {
+ return batchTimeout;
+ }
+
+ public void setBatchTimeout(long batchTimeout) {
+ this.batchTimeout = batchTimeout;
+ }
+
+ // Fluent API
+ //-------------------------------------------------------------------------
+ public AggregatorType batchSize(int batchSize){
+ this.batchSize=batchSize;
+ return this;
+ }
+
+ public AggregatorType batchTimeout(long batchTimeout){
+ this.batchTimeout = batchTimeout;
+ return this;
}
}