Author: ningjiang
Date: Fri Mar 26 03:29:33 2010
New Revision: 927682

URL: http://svn.apache.org/viewvc?rev=927682&view=rev
Log:
CAMEL-1799 Add error handler Spring DSL support so we avoid having to use 
spring bean style

Added:
    
camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/ErrorHandlerDefintion.java
   (with props)
    
camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/handler/ErrorHandlerDefinitionParser.java
   (with props)
    
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringDeadLetterChannelHandlerPolicyNewTest.java
   (with props)
    
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringDeadLetterChannelUseOriginalBodyNewTest.java
   (with props)
    
camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringDeadLetterChannelHandledPolicyNewTest.xml
   (with props)
    
camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringDeadLetterChannelUseOriginalBodyNewTest.xml
   (with props)
Modified:
    camel/trunk/components/camel-spring/pom.xml
    
camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/handler/BeanDefinitionParser.java
    
camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java

Modified: camel/trunk/components/camel-spring/pom.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/pom.xml?rev=927682&r1=927681&r2=927682&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/pom.xml (original)
+++ camel/trunk/components/camel-spring/pom.xml Fri Mar 26 03:29:33 2010
@@ -349,7 +349,8 @@
                                 <fileset dir="${basedir}/src/main/java">
                                   <include 
name="org/apache/camel/spring/Camel*.java" />
                                   <include 
name="org/apache/camel/spring/Endpoint*.java" />
-                                  <include 
name="org/apache/camel/spring/package-info.java" />
+                                 <include 
name="org/apache/camel/spring/ErrorHandler*.java"/>
+                                 <include 
name="org/apache/camel/spring/package-info.java" />
                                 </fileset>
                                 <fileset 
dir="${basedir}/../../camel-core/src/main/java">
                                   <include 
name="org/apache/camel/model/**/*.java" />

Added: 
camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/ErrorHandlerDefintion.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/ErrorHandlerDefintion.java?rev=927682&view=auto
==============================================================================
--- 
camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/ErrorHandlerDefintion.java
 (added)
+++ 
camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/ErrorHandlerDefintion.java
 Fri Mar 26 03:29:33 2010
@@ -0,0 +1,59 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.spring;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.apache.camel.LoggingLevel;
+import org.apache.camel.model.IdentifiedType;
+import org.apache.camel.model.RedeliveryPolicyDefinition;
+import org.apache.camel.model.config.PropertiesDefinition;
+
+/**
+ * The &lt;errorHandler&gt; tag element.
+ *
+ */
+...@xmlrootelement(name = "errorHandler")
+...@xmlaccessortype(XmlAccessType.FIELD)
+public class ErrorHandlerDefintion extends IdentifiedType {
+    @XmlAttribute(required = true)
+    private String type;
+    @XmlAttribute(required = false)
+    private String deadLetterUri;
+    @XmlAttribute(required = false)
+    private LoggingLevel level;
+    @XmlAttribute(required = false)
+    private Boolean handled;
+    @XmlAttribute(required = false)
+    private Boolean useOriginalMessage;
+    @XmlElement(name = "redeliveryPolicy", required = false)
+    private RedeliveryPolicyDefinition redeliveryPolicy;
+    @XmlElements({
+        @XmlElement(name = "exceptionPolicyStrategy",  required = false),
+        @XmlElement(name = "onRedelivery", required = false),
+        @XmlElement(name = "failureProcessor", required = false),
+        @XmlElement(name = "deadLetter", required = false)})
+    private List beans; 
+
+}

Propchange: 
camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/ErrorHandlerDefintion.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/ErrorHandlerDefintion.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: 
camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/handler/BeanDefinitionParser.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/handler/BeanDefinitionParser.java?rev=927682&r1=927681&r2=927682&view=diff
==============================================================================
--- 
camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/handler/BeanDefinitionParser.java
 (original)
+++ 
camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/handler/BeanDefinitionParser.java
 Fri Mar 26 03:29:33 2010
@@ -36,11 +36,11 @@ import org.springframework.util.StringUt
 // with the name "xmlns:"
 public class BeanDefinitionParser extends AbstractSingleBeanDefinitionParser {
     private Class type;
-
+    
     public BeanDefinitionParser(Class type) {
         this.type = type;
     }
-
+   
     protected Class getBeanClass(Element element) {
         return type;
     }

Modified: 
camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java?rev=927682&r1=927681&r2=927682&view=diff
==============================================================================
--- 
camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java
 (original)
+++ 
camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java
 Fri Mar 26 03:29:33 2010
@@ -100,6 +100,8 @@ public class CamelNamespaceHandler exten
         // jmx agent and property placeholder cannot be used outside of the 
camel context
         addBeanDefinitionParser("jmxAgent", CamelJMXAgentDefinition.class, 
false);
         addBeanDefinitionParser("propertyPlaceholder", 
CamelPropertyPlaceholderDefinition.class, false);
+        // errorhandler should not be the sub element of camelContext
+        registerParser("errorHandler", new ErrorHandlerDefinitionParser());
 
         // camel context
         boolean osgi = false;

Added: 
camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/handler/ErrorHandlerDefinitionParser.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/handler/ErrorHandlerDefinitionParser.java?rev=927682&view=auto
==============================================================================
--- 
camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/handler/ErrorHandlerDefinitionParser.java
 (added)
+++ 
camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/handler/ErrorHandlerDefinitionParser.java
 Fri Mar 26 03:29:33 2010
@@ -0,0 +1,124 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.spring.handler;
+
+import java.lang.reflect.Method;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import org.apache.camel.builder.DeadLetterChannelBuilder;
+import org.apache.camel.builder.DefaultErrorHandlerBuilder;
+import org.apache.camel.builder.LoggingErrorHandlerBuilder;
+import org.apache.camel.builder.NoErrorHandlerBuilder;
+import org.apache.camel.processor.RedeliveryPolicy;
+import org.apache.camel.spring.CamelEndpointFactoryBean;
+import org.apache.camel.util.ObjectHelper;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.beans.factory.config.RuntimeBeanReference;
+import org.springframework.beans.factory.parsing.BeanComponentDefinition;
+import org.springframework.beans.factory.support.BeanDefinitionBuilder;
+import 
org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
+import org.springframework.beans.factory.xml.ParserContext;
+
+/**
+ * The DefinitionParser to deal with the ErrorHandler
+ */
+public class ErrorHandlerDefinitionParser extends BeanDefinitionParser {
+    private static final Log LOG = 
LogFactory.getLog(ErrorHandlerDefinitionParser.class);
+    protected BeanDefinitionParser redeliveryPolicyParser = new 
RedeliveryPolicyDefinitionParser(RedeliveryPolicy.class);
+    
+    public ErrorHandlerDefinitionParser() {
+        // Need to override the default 
+        super(null);
+        
+    }
+
+    protected Class getBeanClass(Element element) {
+        String type = element.getAttribute("type");
+        Class clazz = null;
+        if (type.equals("NoErrorHandler")) {
+            clazz = NoErrorHandlerBuilder.class;
+        }
+        if (type.equals("DeadLetterChannel")) {
+            clazz = DeadLetterChannelBuilder.class;
+            
+        }
+        if (type.equals("LoggingErrorHandler")) {
+            clazz = LoggingErrorHandlerBuilder.class;
+        }
+        if (type.equals("DefaultErrorHandler")) {
+            clazz = DefaultErrorHandlerBuilder.class;
+        }
+        if (clazz == null) {
+            throw new IllegalArgumentException("Cannot find the ErrorHandle 
with type " + type);
+        }
+        return clazz;
+    }
+    
+    protected boolean isEligibleAttribute(String attributeName) {
+        return attributeName != null && !ID_ATTRIBUTE.equals(attributeName)
+                && !attributeName.equals("xmlns") && 
!attributeName.startsWith("xmlns:")
+                && !attributeName.equals("type");
+    }
+    
+    @Override
+    protected void doParse(Element element, ParserContext parserContext, 
BeanDefinitionBuilder builder) {
+        super.doParse(element, parserContext, builder);
+        String type = element.getAttribute("type");
+        if (type.equals("NoErrorHandler") || 
type.equals("LoggingErrorHandler")) {
+            // don't need to parser other stuff
+            return;
+        }
+        if (type.equals("DefaultErrorHandler") || 
type.equals("DeadLetterChannel")) {
+            NodeList list = element.getChildNodes();
+            int size = list.getLength();
+            for (int i = 0; i < size; i++) {
+                Node child = list.item(i);
+                if (child instanceof Element) {
+                    Element childElement = (Element)child;
+                    String localName = child.getLocalName();
+                    // set the redeliveryPolicy
+                    if (localName.equals("redeliveryPolicy")) {
+                        BeanDefinition redeliveryPolicyDefinition = 
redeliveryPolicyParser.parse(childElement, parserContext);
+                        builder.addPropertyValue(localName, 
redeliveryPolicyDefinition);
+                    }
+                    if (localName.equals("exceptionPolicyStrategy") || 
localName.equals("onRedelivery")
+                        || localName.equals("failureProcessor") || 
localName.equals("deadLetter")) {
+                        Object value = 
parserContext.getDelegate().parsePropertySubElement(childElement, 
builder.getBeanDefinition());
+                        builder.addPropertyValue(localName, value);
+                    }
+                }
+            }
+        }
+    }
+    
+    class RedeliveryPolicyDefinitionParser extends BeanDefinitionParser {
+        public RedeliveryPolicyDefinitionParser(Class type) {
+            super(type);
+        }
+
+        protected boolean shouldGenerateId() {
+            return true;
+        }
+    }
+    
+}

Propchange: 
camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/handler/ErrorHandlerDefinitionParser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/handler/ErrorHandlerDefinitionParser.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringDeadLetterChannelHandlerPolicyNewTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringDeadLetterChannelHandlerPolicyNewTest.java?rev=927682&view=auto
==============================================================================
--- 
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringDeadLetterChannelHandlerPolicyNewTest.java
 (added)
+++ 
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringDeadLetterChannelHandlerPolicyNewTest.java
 Fri Mar 26 03:29:33 2010
@@ -0,0 +1,28 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.spring.processor;
+
+import org.springframework.context.support.AbstractXmlApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+public class SpringDeadLetterChannelHandlerPolicyNewTest extends 
SpringDeadLetterChannelHandledPolicyTest {
+    
+    protected AbstractXmlApplicationContext createApplicationContext() {
+        return new 
ClassPathXmlApplicationContext("org/apache/camel/spring/processor/SpringDeadLetterChannelHandledPolicyNewTest.xml");
+    }
+
+}

Propchange: 
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringDeadLetterChannelHandlerPolicyNewTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringDeadLetterChannelHandlerPolicyNewTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringDeadLetterChannelUseOriginalBodyNewTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringDeadLetterChannelUseOriginalBodyNewTest.java?rev=927682&view=auto
==============================================================================
--- 
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringDeadLetterChannelUseOriginalBodyNewTest.java
 (added)
+++ 
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringDeadLetterChannelUseOriginalBodyNewTest.java
 Fri Mar 26 03:29:33 2010
@@ -0,0 +1,32 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.spring.processor;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.processor.DeadLetterChannelUseOriginalInBodyTest;
+import static 
org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
+
+/**
+ * @version $Revision$
+ */
+public class SpringDeadLetterChannelUseOriginalBodyNewTest extends 
DeadLetterChannelUseOriginalInBodyTest {
+
+    protected CamelContext createCamelContext() throws Exception {
+        return createSpringCamelContext(this, 
"org/apache/camel/spring/processor/SpringDeadLetterChannelUseOriginalBodyNewTest.xml");
+    }
+
+}

Propchange: 
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringDeadLetterChannelUseOriginalBodyNewTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringDeadLetterChannelUseOriginalBodyNewTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 
camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringDeadLetterChannelHandledPolicyNewTest.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringDeadLetterChannelHandledPolicyNewTest.xml?rev=927682&view=auto
==============================================================================
--- 
camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringDeadLetterChannelHandledPolicyNewTest.xml
 (added)
+++ 
camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringDeadLetterChannelHandledPolicyNewTest.xml
 Fri Mar 26 03:29:33 2010
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans";
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+       xmlns:camel = "http://camel.apache.org/schema/spring";
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+       http://camel.apache.org/schema/spring 
http://camel.apache.org/schema/spring/camel-spring.xsd
+    ">
+
+    <!-- START SNIPPET: e1 -->
+    <camel:errorHandler id="myDLC" type="DeadLetterChannel" 
deadLetterUri="mock:dead" handled="true">
+       <camel:redeliveryPolicy maximumRedeliveries="2" redeliveryDelay="0" 
logStackTrace="false" />
+    </camel:errorHandler>
+
+    <!-- END SNIPPET: e1 -->
+
+    <bean id="myThrowProcessor" 
class="org.apache.camel.processor.DeadLetterChannelHandledPolicyTest$MyThrowExceptionProcessor"/>
+
+    <camelContext id="camel" errorHandlerRef="myDLC" 
xmlns="http://camel.apache.org/schema/spring";>
+        <route>
+            <from uri="direct:start"/>
+            <process ref="myThrowProcessor"/>
+        </route>
+    </camelContext>
+</beans>

Propchange: 
camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringDeadLetterChannelHandledPolicyNewTest.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringDeadLetterChannelHandledPolicyNewTest.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: 
camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringDeadLetterChannelHandledPolicyNewTest.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: 
camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringDeadLetterChannelUseOriginalBodyNewTest.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringDeadLetterChannelUseOriginalBodyNewTest.xml?rev=927682&view=auto
==============================================================================
--- 
camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringDeadLetterChannelUseOriginalBodyNewTest.xml
 (added)
+++ 
camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringDeadLetterChannelUseOriginalBodyNewTest.xml
 Fri Mar 26 03:29:33 2010
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans";
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+       http://camel.apache.org/schema/spring 
http://camel.apache.org/schema/spring/camel-spring.xsd
+    ">
+
+    <!-- START SNIPPET: e1 -->
+    <errorHandler id="a" type="DeadLetterChannel" deadLetterUri="mock:a" 
handled="true"
+       useOriginalMessage="true" xmlns="http://camel.apache.org/schema/spring";>
+       <redeliveryPolicy maximumRedeliveries="2" redeliveryDelay="0" 
logStackTrace="false" />
+    </errorHandler>
+    <!-- END SNIPPET: e1 -->
+
+     <errorHandler id="b" type="DeadLetterChannel" deadLetterUri="mock:b" 
handled="true"
+       useOriginalMessage="false" 
xmlns="http://camel.apache.org/schema/spring";>
+       <redeliveryPolicy maximumRedeliveries="2" redeliveryDelay="0" 
logStackTrace="false" />
+    </errorHandler>
+
+    <bean id="myThrowProcessor" 
class="org.apache.camel.processor.DeadLetterChannelUseOriginalInBodyTest$MyThrowProcessor"/>
+
+    <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring";>
+        <route errorHandlerRef="a">
+            <from uri="direct:a"/>
+            <setBody><simple>${in.body} World</simple></setBody>
+            <process ref="myThrowProcessor"/>
+        </route>
+
+        <route errorHandlerRef="b">
+            <from uri="direct:b"/>
+            <setBody><simple>${in.body} World</simple></setBody>
+            <process ref="myThrowProcessor"/>
+        </route>
+    </camelContext>
+</beans>

Propchange: 
camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringDeadLetterChannelUseOriginalBodyNewTest.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringDeadLetterChannelUseOriginalBodyNewTest.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: 
camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringDeadLetterChannelUseOriginalBodyNewTest.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml


Reply via email to