camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject svn commit: r1165267 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/component/bean/ camel-core/src/main/java/org/apache/camel/component/file/ components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/seda/ components/c...
Date Mon, 05 Sep 2011 12:56:45 GMT
Author: cschneider
Date: Mon Sep  5 12:56:45 2011
New Revision: 1165267

URL: http://svn.apache.org/viewvc?rev=1165267&view=rev
Log:
Avoiding new DefaultExchange where it can be easily created using the endpoint

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/CamelInvocationHandler.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
    camel/trunk/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/seda/HazelcastSedaConsumer.java
    camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/EndpointMessageListener.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/CamelInvocationHandler.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/CamelInvocationHandler.java?rev=1165267&r1=1165266&r2=1165267&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/CamelInvocationHandler.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/CamelInvocationHandler.java
Mon Sep  5 12:56:45 2011
@@ -33,7 +33,6 @@ import org.apache.camel.ExchangePattern;
 import org.apache.camel.InvalidPayloadException;
 import org.apache.camel.Producer;
 import org.apache.camel.RuntimeCamelException;
-import org.apache.camel.impl.DefaultExchange;
 import org.apache.camel.util.ObjectHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -65,7 +64,7 @@ public class CamelInvocationHandler impl
         MethodInfo methodInfo = methodInfoCache.getMethodInfo(method);
 
         final ExchangePattern pattern = methodInfo != null ? methodInfo.getPattern() : ExchangePattern.InOut;
-        final Exchange exchange = new DefaultExchange(endpoint, pattern);
+        final Exchange exchange = endpoint.createExchange(pattern);
         exchange.getIn().setBody(invocation);
 
         // is the return type a future

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java?rev=1165267&r1=1165266&r2=1165267&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java
Mon Sep  5 12:56:45 2011
@@ -22,7 +22,6 @@ import java.io.FileNotFoundException;
 import org.apache.camel.Component;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
-import org.apache.camel.impl.DefaultExchange;
 import org.apache.camel.processor.idempotent.MemoryIdempotentRepository;
 import org.apache.camel.util.FileUtil;
 import org.apache.camel.util.ObjectHelper;
@@ -104,7 +103,7 @@ public class FileEndpoint extends Generi
     }
 
     public Exchange createExchange(GenericFile<File> file) {
-        Exchange exchange = new DefaultExchange(this);
+        Exchange exchange =  createExchange();
         if (file != null) {
             file.bindToExchange(exchange);
         }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java?rev=1165267&r1=1165266&r2=1165267&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
Mon Sep  5 12:56:45 2011
@@ -27,7 +27,6 @@ import org.apache.camel.BatchConsumer;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.ShutdownRunningTask;
-import org.apache.camel.impl.DefaultExchange;
 import org.apache.camel.impl.ScheduledPollConsumer;
 import org.apache.camel.spi.ShutdownAware;
 import org.apache.camel.util.CastUtils;
@@ -518,7 +517,7 @@ public abstract class GenericFileConsume
     private void evaluateFileExpression() {
         if (fileExpressionResult == null) {
             // create a dummy exchange as Exchange is needed for expression evaluation
-            Exchange dummy = new DefaultExchange(endpoint.getCamelContext());
+            Exchange dummy = endpoint.createExchange();
             fileExpressionResult = endpoint.getFileName().evaluate(dummy, String.class);
         }
     }

Modified: camel/trunk/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/seda/HazelcastSedaConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/seda/HazelcastSedaConsumer.java?rev=1165267&r1=1165266&r2=1165267&view=diff
==============================================================================
--- camel/trunk/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/seda/HazelcastSedaConsumer.java
(original)
+++ camel/trunk/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/seda/HazelcastSedaConsumer.java
Mon Sep  5 12:56:45 2011
@@ -27,7 +27,6 @@ import org.apache.camel.Endpoint;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.impl.DefaultConsumer;
-import org.apache.camel.impl.DefaultExchange;
 import org.apache.camel.impl.DefaultExchangeHolder;
 import org.apache.camel.impl.converter.AsyncProcessorTypeConverter;
 import org.slf4j.Logger;
@@ -73,7 +72,7 @@ public class HazelcastSedaConsumer exten
         final BlockingQueue queue = endpoint.getQueue();
 
         while (queue != null && isRunAllowed()) {
-            final Exchange exchange = new DefaultExchange(this.getEndpoint().getCamelContext());
+            final Exchange exchange = this.getEndpoint().createExchange();
 
             try {
                 final Object body = queue.poll(endpoint.getConfiguration().getPollInterval(),
TimeUnit.MILLISECONDS);

Modified: camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/EndpointMessageListener.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/EndpointMessageListener.java?rev=1165267&r1=1165266&r2=1165267&view=diff
==============================================================================
--- camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/EndpointMessageListener.java
(original)
+++ camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/EndpointMessageListener.java
Mon Sep  5 12:56:45 2011
@@ -27,7 +27,6 @@ import org.apache.camel.ExchangePattern;
 import org.apache.camel.Processor;
 import org.apache.camel.RollbackExchangeException;
 import org.apache.camel.RuntimeCamelException;
-import org.apache.camel.impl.DefaultExchange;
 import org.apache.camel.impl.LoggingExceptionHandler;
 import org.apache.camel.spi.ExceptionHandler;
 import org.apache.camel.util.ObjectHelper;
@@ -156,7 +155,7 @@ public class EndpointMessageListener imp
     }
 
     public Exchange createExchange(Message message, Object replyDestination) {
-        Exchange exchange = new DefaultExchange(endpoint, endpoint.getExchangePattern());
+        Exchange exchange = endpoint.createExchange();
         JmsBinding binding = getBinding();
         exchange.setProperty(Exchange.BINDING, binding);
         exchange.setIn(new JmsMessage(message, binding));



Mime
View raw message