camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject svn commit: r1152957 - /camel/trunk/camel-core/src/main/java/org/apache/camel/model/
Date Mon, 01 Aug 2011 22:40:27 GMT
Author: cschneider
Date: Mon Aug  1 22:40:24 2011
New Revision: 1152957

URL: http://svn.apache.org/viewvc?rev=1152957&view=rev
Log:
CAMEL-4244 Moved default values to createProcessor

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/AggregateDefinition.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/DelayDefinition.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/MulticastDefinition.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnCompletionDefinition.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/SplitDefinition.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/ThrottleDefinition.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/WireTapDefinition.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/AggregateDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/AggregateDefinition.java?rev=1152957&r1=1152956&r2=1152957&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/AggregateDefinition.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/AggregateDefinition.java Mon
Aug  1 22:40:24 2011
@@ -70,7 +70,7 @@ public class AggregateDefinition extends
     @XmlAttribute
     private Boolean parallelProcessing;
     @XmlAttribute
-    private String executorServiceRef = "Aggregator";
+    private String executorServiceRef;
     @XmlAttribute
     private String aggregationRepositoryRef;
     @XmlAttribute
@@ -98,18 +98,21 @@ public class AggregateDefinition extends
     }
 
     public AggregateDefinition(Predicate predicate) {
+        this();
         if (predicate != null) {
             setExpression(new ExpressionDefinition(predicate));
         }
     }    
     
     public AggregateDefinition(Expression correlationExpression) {
+        this();
         if (correlationExpression != null) {
             setExpression(new ExpressionDefinition(correlationExpression));
         }
     }
 
     public AggregateDefinition(ExpressionDefinition correlationExpression) {
+        this();
         this.expression = correlationExpression;
     }
 
@@ -151,12 +154,13 @@ public class AggregateDefinition extends
         AggregationStrategy strategy = createAggregationStrategy(routeContext);
 
         if (executorService == null) {
+            String ref = executorServiceRef != null ? executorServiceRef : "Aggregator";
             // executor service is mandatory for the Aggregator
             ExecutorServiceManager executorServiceManager = routeContext.getCamelContext().getExecutorServiceManager();
             if (isParallelProcessing()) {
-                executorService = executorServiceManager.getDefaultExecutorService(executorServiceRef,
this);
+                executorService = executorServiceManager.getDefaultExecutorService(ref, this);
             } else {
-                executorService = executorServiceManager.newSynchronousExecutorService(executorServiceRef,
this);
+                executorService = executorServiceManager.newSynchronousExecutorService(ref,
this);
             }
         }
         AggregateProcessor answer = new AggregateProcessor(routeContext.getCamelContext(),
processor, correlation, strategy, executorService);

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/DelayDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/DelayDefinition.java?rev=1152957&r1=1152956&r2=1152957&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/DelayDefinition.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/DelayDefinition.java Mon Aug
 1 22:40:24 2011
@@ -48,7 +48,7 @@ public class DelayDefinition extends Exp
     @XmlTransient
     private ExecutorService executorService;
     @XmlAttribute
-    private String executorServiceRef = "Delay";
+    private String executorServiceRef;
     @XmlAttribute
     private Boolean asyncDelayed;
     @XmlAttribute
@@ -83,8 +83,9 @@ public class DelayDefinition extends Exp
 
         ScheduledExecutorService scheduled = null;
         if (getAsyncDelayed() != null && getAsyncDelayed()) {
+            String ref = executorServiceRef != null ? executorServiceRef : "Delay";
             ExecutorServiceManager manager = routeContext.getCamelContext().getExecutorServiceManager();
-            scheduled = manager.getScheduledExecutorService(executorServiceRef, this);
+            scheduled = manager.getScheduledExecutorService(ref, this);
         }
 
         Delayer answer = new Delayer(childProcessor, delay, scheduled);

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/MulticastDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/MulticastDefinition.java?rev=1152957&r1=1152956&r2=1152957&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/MulticastDefinition.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/MulticastDefinition.java Mon
Aug  1 22:40:24 2011
@@ -49,7 +49,7 @@ public class MulticastDefinition extends
     @XmlTransient
     private ExecutorService executorService;
     @XmlAttribute
-    private String executorServiceRef = "Multicast";
+    private String executorServiceRef;
     @XmlAttribute
     private Boolean streaming;
     @XmlAttribute
@@ -219,7 +219,8 @@ public class MulticastDefinition extends
 
         ExecutorServiceManager executorServiceManager = routeContext.getCamelContext().getExecutorServiceManager();
         if (isParallelProcessing() && executorService == null) {
-            executorService = executorServiceManager.getDefaultExecutorService(executorServiceRef,
this);
+            String ref = this.executorServiceRef != null ? this.executorServiceRef : "Delay";
+            executorService = executorServiceManager.getDefaultExecutorService(ref, this);
         }
         long timeout = getTimeout() != null ? getTimeout() : 0;
         if (timeout > 0 && !isParallelProcessing()) {

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnCompletionDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnCompletionDefinition.java?rev=1152957&r1=1152956&r2=1152957&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnCompletionDefinition.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnCompletionDefinition.java
Mon Aug  1 22:40:24 2011
@@ -33,6 +33,7 @@ import org.apache.camel.Predicate;
 import org.apache.camel.Processor;
 import org.apache.camel.processor.OnCompletionProcessor;
 import org.apache.camel.processor.UnitOfWorkProcessor;
+import org.apache.camel.spi.ExecutorServiceManager;
 import org.apache.camel.spi.RouteContext;
 
 /**
@@ -50,7 +51,7 @@ public class OnCompletionDefinition exte
     @XmlElement(name = "onWhen")
     private WhenDefinition onWhen;
     @XmlAttribute
-    private String executorServiceRef = "OnCompletion";
+    private String executorServiceRef;
     @XmlAttribute(name = "useOriginalMessage")
     private Boolean useOriginalMessagePolicy;
     @XmlElementRef
@@ -97,7 +98,9 @@ public class OnCompletionDefinition exte
             when = onWhen.getExpression().createPredicate(routeContext);
         }
 
-        executorService = routeContext.getCamelContext().getExecutorServiceManager().getDefaultExecutorService(executorServiceRef,
this);
+        String ref = this.executorServiceRef != null ? this.executorServiceRef : "OnCompletion";
+        ExecutorServiceManager manager = routeContext.getCamelContext().getExecutorServiceManager();
+        executorService = manager.getDefaultExecutorService(ref, this);
 
         // should be false by default
         boolean original = getUseOriginalMessagePolicy() != null ? getUseOriginalMessagePolicy()
: false;

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java?rev=1152957&r1=1152956&r2=1152957&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java
Mon Aug  1 22:40:24 2011
@@ -30,6 +30,7 @@ import org.apache.camel.model.language.E
 import org.apache.camel.processor.RecipientList;
 import org.apache.camel.processor.aggregate.AggregationStrategy;
 import org.apache.camel.processor.aggregate.UseLatestAggregationStrategy;
+import org.apache.camel.spi.ExecutorServiceManager;
 import org.apache.camel.spi.RouteContext;
 import org.apache.camel.util.CamelContextHelper;
 
@@ -52,7 +53,7 @@ public class RecipientListDefinition<Typ
     @XmlAttribute
     private String strategyRef;
     @XmlAttribute
-    private String executorServiceRef = "RecipientList";
+    private String executorServiceRef;
     @XmlAttribute
     private Boolean stopOnException;
     @XmlAttribute
@@ -124,7 +125,9 @@ public class RecipientListDefinition<Typ
             answer.setTimeout(getTimeout());
         }
         if (isParallelProcessing() && executorService == null) {
-            executorService = routeContext.getCamelContext().getExecutorServiceManager().getDefaultExecutorService(executorServiceRef,
this);
+            String ref = this.executorServiceRef != null ? this.executorServiceRef : "RecipientList";
+            ExecutorServiceManager manager = routeContext.getCamelContext().getExecutorServiceManager();
+            executorService = manager.getDefaultExecutorService(ref, this);
         }
         answer.setExecutorService(executorService);
         long timeout = getTimeout() != null ? getTimeout() : 0;

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/SplitDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/SplitDefinition.java?rev=1152957&r1=1152956&r2=1152957&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/SplitDefinition.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/SplitDefinition.java Mon Aug
 1 22:40:24 2011
@@ -30,6 +30,7 @@ import org.apache.camel.model.language.E
 import org.apache.camel.processor.Splitter;
 import org.apache.camel.processor.SubUnitOfWorkProcessor;
 import org.apache.camel.processor.aggregate.AggregationStrategy;
+import org.apache.camel.spi.ExecutorServiceManager;
 import org.apache.camel.spi.RouteContext;
 import org.apache.camel.util.CamelContextHelper;
 
@@ -50,7 +51,7 @@ public class SplitDefinition extends Exp
     @XmlAttribute
     private String strategyRef;
     @XmlAttribute
-    private String executorServiceRef = "Split";
+    private String executorServiceRef;
     @XmlAttribute
     private Boolean streaming;
     @XmlAttribute
@@ -95,7 +96,9 @@ public class SplitDefinition extends Exp
         Processor childProcessor = this.createChildProcessor(routeContext, true);
         aggregationStrategy = createAggregationStrategy(routeContext);
         if (isParallelProcessing() && executorService == null) {
-            executorService = routeContext.getCamelContext().getExecutorServiceManager().getDefaultExecutorService(executorServiceRef,
this);
+            String ref = this.executorServiceRef != null ? this.executorServiceRef : "Split";
+            ExecutorServiceManager manager = routeContext.getCamelContext().getExecutorServiceManager();
+            executorService = manager.getDefaultExecutorService(ref, this);
         }
 
         long timeout = getTimeout() != null ? getTimeout() : 0;

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/ThrottleDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ThrottleDefinition.java?rev=1152957&r1=1152956&r2=1152957&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/ThrottleDefinition.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/ThrottleDefinition.java Mon
Aug  1 22:40:24 2011
@@ -30,6 +30,7 @@ import org.apache.camel.Processor;
 import org.apache.camel.builder.ExpressionBuilder;
 import org.apache.camel.model.language.ExpressionDefinition;
 import org.apache.camel.processor.Throttler;
+import org.apache.camel.spi.ExecutorServiceManager;
 import org.apache.camel.spi.RouteContext;
 import org.apache.camel.util.ObjectHelper;
 
@@ -46,7 +47,7 @@ public class ThrottleDefinition extends 
     @XmlTransient
     private ExecutorService executorService;
     @XmlAttribute
-    private String executorServiceRef = "Throttle";
+    private String executorServiceRef;
     @XmlAttribute
     private Long timePeriodMillis;
     @XmlAttribute
@@ -86,7 +87,9 @@ public class ThrottleDefinition extends 
 
         ScheduledExecutorService scheduled = null;
         if (getAsyncDelayed() != null && getAsyncDelayed()) {
-            scheduled = routeContext.getCamelContext().getExecutorServiceManager().getScheduledExecutorService(executorServiceRef,
this);
+            String ref = this.executorServiceRef != null ? this.executorServiceRef : "Throttle";
+            ExecutorServiceManager manager = routeContext.getCamelContext().getExecutorServiceManager();
+            scheduled = manager.getScheduledExecutorService(ref, this);
         }
 
         // should be default 1000 millis

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/WireTapDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/WireTapDefinition.java?rev=1152957&r1=1152956&r2=1152957&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/WireTapDefinition.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/WireTapDefinition.java Mon
Aug  1 22:40:24 2011
@@ -33,6 +33,7 @@ import org.apache.camel.ExchangePattern;
 import org.apache.camel.Expression;
 import org.apache.camel.Processor;
 import org.apache.camel.processor.WireTapProcessor;
+import org.apache.camel.spi.ExecutorServiceManager;
 import org.apache.camel.spi.RouteContext;
 import org.apache.camel.util.CamelContextHelper;
 
@@ -59,7 +60,7 @@ public class WireTapDefinition<Type exte
     @XmlTransient
     private ExecutorService executorService;
     @XmlAttribute
-    private String executorServiceRef = "WireTap";
+    private String executorServiceRef;
     @XmlAttribute
     private Boolean copy;
     @XmlAttribute
@@ -71,10 +72,12 @@ public class WireTapDefinition<Type exte
     }
 
     public WireTapDefinition(String uri) {
+        this();
         setUri(uri);
     }
 
     public WireTapDefinition(Endpoint endpoint) {
+        this();
         setEndpoint(endpoint);
     }
 
@@ -82,7 +85,9 @@ public class WireTapDefinition<Type exte
     public Processor createProcessor(RouteContext routeContext) throws Exception {
         Endpoint endpoint = resolveEndpoint(routeContext);
 
-        executorService = routeContext.getCamelContext().getExecutorServiceManager().getDefaultExecutorService(executorServiceRef,
this);
+        String ref = this.executorServiceRef != null ? this.executorServiceRef : "WireTap";
+        ExecutorServiceManager manager = routeContext.getCamelContext().getExecutorServiceManager();
+        executorService = manager.getDefaultExecutorService(ref, this);
         WireTapProcessor answer = new WireTapProcessor(endpoint, getPattern(), executorService);
 
         answer.setCopy(isCopy());



Mime
View raw message