camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r774230 - in /camel/trunk/camel-core/src: main/java/org/apache/camel/builder/ main/java/org/apache/camel/model/ main/java/org/apache/camel/processor/ test/java/org/apache/camel/processor/ test/java/org/apache/camel/processor/onexception/
Date Wed, 13 May 2009 06:18:25 GMT
Author: davsclaus
Date: Wed May 13 06:18:24 2009
New Revision: 774230

URL: http://svn.apache.org/viewvc?rev=774230&view=rev
Log:
CAMEL-1600: only the original IN body is copied to avoid problem with camel-jms and the fact
that its only the IN body we really need to copy

Added:
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionFromChoiceUseOriginalBodyTest.java
  (contents, props changed)
      - copied, changed from r774185, camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionFromChoiceUseOriginalExchangeTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionUseOriginalBodyTest.java
  (contents, props changed)
      - copied, changed from r774185, camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionUseOriginalExchangeTest.java
Removed:
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionFromChoiceUseOriginalExchangeTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionUseOriginalExchangeTest.java
Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/builder/DeadLetterChannelBuilder.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DeadLetterChannel.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelUseOriginalInBodyTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelUseOriginalInBodyWithFileTest.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/builder/DeadLetterChannelBuilder.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/DeadLetterChannelBuilder.java?rev=774230&r1=774229&r2=774230&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/builder/DeadLetterChannelBuilder.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/builder/DeadLetterChannelBuilder.java
Wed May 13 06:18:24 2009
@@ -50,7 +50,7 @@
     private Endpoint deadLetter;
     private String deadLetterUri;
     private Predicate handledPolicy;
-    private boolean useOriginalInBody;
+    private boolean useOriginalBody;
 
     /**
      * Creates a default DeadLetterChannel with a default endpoint
@@ -79,7 +79,7 @@
 
     public Processor createErrorHandler(RouteContext routeContext, Processor processor) throws
Exception {
         DeadLetterChannel answer = new DeadLetterChannel(processor, getFailureProcessor(),
deadLetterUri, onRedelivery,
-                getRedeliveryPolicy(), getLogger(), getExceptionPolicyStrategy(), getHandledPolicy(),
isUseOriginalInBody());
+                getRedeliveryPolicy(), getLogger(), getExceptionPolicyStrategy(), getHandledPolicy(),
isUseOriginalBody());
         // must enable stream cache as DeadLetterChannel can do redeliveries and
         // thus it needs to be able to read the stream again
         configure(answer);
@@ -275,8 +275,8 @@
      *
      * @return the builder
      */
-    public DeadLetterChannelBuilder useOriginalInBody() {
-        setUseOriginalInBody(true);
+    public DeadLetterChannelBuilder useOriginalBody() {
+        setUseOriginalBody(true);
         return this;
     }
 
@@ -379,12 +379,12 @@
         handled(handled);
     }
 
-    public boolean isUseOriginalInBody() {
-        return useOriginalInBody;
+    public boolean isUseOriginalBody() {
+        return useOriginalBody;
     }
 
-    public void setUseOriginalInBody(boolean useOriginalInBody) {
-        this.useOriginalInBody = useOriginalInBody;
+    public void setUseOriginalBody(boolean useOriginalBody) {
+        this.useOriginalBody = useOriginalBody;
     }
 
     @Override

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java?rev=774230&r1=774229&r2=774230&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java
Wed May 13 06:18:24 2009
@@ -65,8 +65,8 @@
     private ExpressionSubElementDefinition handled;
     @XmlAttribute(name = "onRedeliveryRef", required = false)
     private String onRedeliveryRef;
-    @XmlAttribute(name = "useOriginalExchange", required = false)
-    private Boolean useOriginalExchangePolicy = Boolean.FALSE;
+    @XmlAttribute(name = "useOriginalBody", required = false)
+    private Boolean useOriginalBodyPolicy = Boolean.FALSE;
     @XmlElementRef
     private List<ProcessorDefinition> outputs = new ArrayList<ProcessorDefinition>();
     @XmlTransient
@@ -361,7 +361,7 @@
     }
 
     /**
-     * Will use the original input {@link org.apache.camel.Exchange} when an {@link org.apache.camel.Exchange}
is moved to the dead letter queue.
+     * Will use the original input body when an {@link org.apache.camel.Exchange} is moved
to the dead letter queue.
      * <p/>
      * <b>Notice:</b> this only applies when all redeliveries attempt have failed
and the {@link org.apache.camel.Exchange} is doomed for failure.
      * <br/>
@@ -375,8 +375,8 @@
      *
      * @return the builder
      */
-    public OnExceptionDefinition useOriginalExchange() {
-        setUseOriginalExchangePolicy(Boolean.TRUE);
+    public OnExceptionDefinition useOriginalBody() {
+        setUseOriginalBodyPolicy(Boolean.TRUE);
         return this;
     }
 
@@ -487,12 +487,12 @@
         this.onRedeliveryRef = onRedeliveryRef;
     }
 
-    public Boolean getUseOriginalExchangePolicy() {
-        return useOriginalExchangePolicy;
+    public Boolean getUseOriginalBodyPolicy() {
+        return useOriginalBodyPolicy;
     }
 
-    public void setUseOriginalExchangePolicy(Boolean useOriginalExchangePolicy) {
-        this.useOriginalExchangePolicy = useOriginalExchangePolicy;
+    public void setUseOriginalBodyPolicy(Boolean useOriginalBodyPolicy) {
+        this.useOriginalBodyPolicy = useOriginalBodyPolicy;
     }
 
     // Implementation methods

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DeadLetterChannel.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DeadLetterChannel.java?rev=774230&r1=774229&r2=774230&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DeadLetterChannel.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DeadLetterChannel.java
Wed May 13 06:18:24 2009
@@ -55,7 +55,7 @@
     private final RedeliveryPolicy redeliveryPolicy;
     private final Predicate handledPolicy;
     private final Logger logger;
-    private final boolean useOriginalInBodyPolicy;
+    private final boolean useOriginalBodyPolicy;
 
     private class RedeliveryData {
         int redeliveryCounter;
@@ -67,7 +67,7 @@
         Processor deadLetterQueue = deadLetter;
         Processor onRedeliveryProcessor = redeliveryProcessor;
         Predicate handledPredicate = handledPolicy;
-        boolean useOriginalInBody = useOriginalInBodyPolicy;
+        boolean useOriginalInBody = useOriginalBodyPolicy;
     }
     
     /**
@@ -81,11 +81,11 @@
      * @param logger                    logger to use for logging failures and redelivery
attempts
      * @param exceptionPolicyStrategy   strategy for onException handling
      * @param handledPolicy             policy for handling failed exception that are moved
to the dead letter queue
-     * @param useOriginalInBodyPolicy   should the original IN body be moved to the dead
letter queue or the current exchange IN body?
+     * @param useOriginalBodyPolicy   should the original IN body be moved to the dead letter
queue or the current exchange IN body?
      */
     public DeadLetterChannel(Processor output, Processor deadLetter, String deadLetterUri,
Processor redeliveryProcessor,
                              RedeliveryPolicy redeliveryPolicy, Logger logger, ExceptionPolicyStrategy
exceptionPolicyStrategy,
-                             Predicate handledPolicy, boolean useOriginalInBodyPolicy) {
+                             Predicate handledPolicy, boolean useOriginalBodyPolicy) {
         this.output = output;
         this.deadLetter = deadLetter;
         this.deadLetterUri = deadLetterUri;
@@ -93,7 +93,7 @@
         this.redeliveryPolicy = redeliveryPolicy;
         this.logger = logger;
         this.handledPolicy = handledPolicy;
-        this.useOriginalInBodyPolicy = useOriginalInBodyPolicy;
+        this.useOriginalBodyPolicy = useOriginalBodyPolicy;
         setExceptionPolicy(exceptionPolicyStrategy);
     }
 
@@ -239,7 +239,7 @@
             data.currentRedeliveryPolicy = exceptionPolicy.createRedeliveryPolicy(exchange.getContext(),
data.currentRedeliveryPolicy);
             data.handledPredicate = exceptionPolicy.getHandledPolicy();
             data.retryUntilPredicate = exceptionPolicy.getRetryUntilPolicy();
-            data.useOriginalInBody = exceptionPolicy.getUseOriginalExchangePolicy();
+            data.useOriginalInBody = exceptionPolicy.getUseOriginalBodyPolicy();
 
             // route specific failure handler?
             Processor processor = exceptionPolicy.getErrorHandler();

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelUseOriginalInBodyTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelUseOriginalInBodyTest.java?rev=774230&r1=774229&r2=774230&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelUseOriginalInBodyTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelUseOriginalInBodyTest.java
Wed May 13 06:18:24 2009
@@ -55,7 +55,7 @@
             public void configure() throws Exception {
                 // will use original
                 DeadLetterChannelBuilder a = deadLetterChannel("mock:a")
-                    .maximumRedeliveries(2).delay(0).logStackTrace(false).useOriginalInBody().handled(true);
+                    .maximumRedeliveries(2).delay(0).logStackTrace(false).useOriginalBody().handled(true);
 
                 // will NOT use original
                 DeadLetterChannelBuilder b = deadLetterChannel("mock:b")

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelUseOriginalInBodyWithFileTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelUseOriginalInBodyWithFileTest.java?rev=774230&r1=774229&r2=774230&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelUseOriginalInBodyWithFileTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelUseOriginalInBodyWithFileTest.java
Wed May 13 06:18:24 2009
@@ -50,7 +50,7 @@
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                errorHandler(deadLetterChannel("mock:dead").disableRedelivery().logStackTrace(false).useOriginalInBody().handled(true));
+                errorHandler(deadLetterChannel("mock:dead").disableRedelivery().logStackTrace(false).useOriginalBody().handled(true));
 
                 from("file://target/originalexchange?noop=true")
                     .transform(body().append(" World"))

Copied: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionFromChoiceUseOriginalBodyTest.java
(from r774185, camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionFromChoiceUseOriginalExchangeTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionFromChoiceUseOriginalBodyTest.java?p2=camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionFromChoiceUseOriginalBodyTest.java&p1=camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionFromChoiceUseOriginalExchangeTest.java&r1=774185&r2=774230&rev=774230&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionFromChoiceUseOriginalExchangeTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionFromChoiceUseOriginalBodyTest.java
Wed May 13 06:18:24 2009
@@ -24,7 +24,7 @@
 /**
  * Unit test for CAMEL-1188
  */
-public class OnExceptionFromChoiceUseOriginalExchangeTest extends ContextTestSupport {
+public class OnExceptionFromChoiceUseOriginalBodyTest extends ContextTestSupport {
 
     private MyServiceBean myServiceBean;
 
@@ -90,8 +90,8 @@
             public void configure() throws Exception {
                 errorHandler(deadLetterChannel("mock:error"));
 
-                onException(MyTechnicalException.class).useOriginalExchange().maximumRedeliveries(0).handled(true).to("mock:tech");
-                onException(MyFunctionalException.class).useOriginalExchange().maximumRedeliveries(0).handled(true).to("mock:func");
+                onException(MyTechnicalException.class).useOriginalBody().maximumRedeliveries(0).handled(true).to("mock:tech");
+                onException(MyFunctionalException.class).useOriginalBody().maximumRedeliveries(0).handled(true).to("mock:func");
 
                 from("direct:tech")
                     .setBody(constant("<order><type>myType</type><user>Tech</user></order>"))

Propchange: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionFromChoiceUseOriginalBodyTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionFromChoiceUseOriginalBodyTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Copied: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionUseOriginalBodyTest.java
(from r774185, camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionUseOriginalExchangeTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionUseOriginalBodyTest.java?p2=camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionUseOriginalBodyTest.java&p1=camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionUseOriginalExchangeTest.java&r1=774185&r2=774230&rev=774230&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionUseOriginalExchangeTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionUseOriginalBodyTest.java
Wed May 13 06:18:24 2009
@@ -25,13 +25,13 @@
 import org.apache.camel.component.mock.MockEndpoint;
 
 /**
- * Unit test for useOriginalExchange option on DeadLetterChannel
+ * Unit test for useOriginalBody option on DeadLetterChannel
  *
  * @version $Revision$
  */
-public class OnExceptionUseOriginalExchangeTest extends ContextTestSupport {
+public class OnExceptionUseOriginalBodyTest extends ContextTestSupport {
 
-    public void testUseOriginalExchange() throws Exception {
+    public void testUseOriginalBody() throws Exception {
         MockEndpoint dead = getMockEndpoint("mock:a");
         dead.expectedBodiesReceived("Hello");
 
@@ -40,7 +40,7 @@
         assertMockEndpointsSatisfied();
     }
 
-    public void testDoNotUseOriginalExchange() throws Exception {
+    public void testDoNotUseOriginalBody() throws Exception {
         MockEndpoint dead = getMockEndpoint("mock:dead");
         dead.expectedBodiesReceived("Hello World");
 
@@ -64,7 +64,7 @@
 
                 // will use original exchange
                 onException(IllegalArgumentException.class)
-                    .maximumRedeliveries(2).useOriginalExchange().handled(true)
+                    .maximumRedeliveries(2).useOriginalBody().handled(true)
                     .to("mock:a");
 
                 from("direct:a")

Propchange: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionUseOriginalBodyTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionUseOriginalBodyTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date



Mime
View raw message