camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r736301 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/model/ camel-core/src/main/java/org/apache/camel/processor/ camel-core/src/test/java/org/apache/camel/model/ camel-core/src/test/java/org/apache/camel/processor/routingsli...
Date Wed, 21 Jan 2009 12:46:38 GMT
Author: davsclaus
Date: Wed Jan 21 04:46:35 2009
New Revision: 736301

URL: http://svn.apache.org/viewvc?rev=736301&view=rev
Log:
Removed @deprecated code in routingSlip. A header should always be provided as it makes the
DSL more intuitive.

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/RoutingSlipType.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/model/XmlParseTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/routingslip/RoutingSlipTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/routingslip/RoutingSlipWithExceptionTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/routingslip/RoutingSlipWithNonStandardExchangeTest.java
    camel/trunk/camel-core/src/test/resources/org/apache/camel/model/routingSlip.xml
    camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/routingSlip.xml

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java?rev=736301&r1=736300&r2=736301&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java Wed Jan
21 04:46:35 2009
@@ -735,23 +735,6 @@
     }
 
     /**
-     * <a href="http://activemq.apache.org/camel/routing-slip.html">Routing Slip EIP:</a>
-     * Creates a routing slip allowing you to route a message consecutively through a series
of processing
-     * steps where the sequence of steps is not known at design time and can vary for each
message.
-     * <p>
-     * The header will use the default header {@link RoutingSlipType#DEFAULT_DELIMITER}
-     * The list of URIs will be split based on the default delimiter {@link RoutingSlipType#DEFAULT_DELIMITER}
-     *
-     * @return the builder
-     * @deprecated will be removed in Camel 2.0
-     */
-    public Type routingSlip() {
-        RoutingSlipType answer = new RoutingSlipType();
-        addOutput(answer);
-        return (Type) this;
-    }
-
-    /**
      * <a href="http://activemq.apache.org/camel/splitter.html">Splitter EIP:</a>
      * Creates a splitter allowing you split a message into a number of pieces and process
them individually.
      * <p>

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/RoutingSlipType.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/RoutingSlipType.java?rev=736301&r1=736300&r2=736301&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/RoutingSlipType.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/RoutingSlipType.java Wed Jan
21 04:46:35 2009
@@ -35,7 +35,6 @@
 @XmlRootElement(name = "routingSlip")
 @XmlAccessorType(XmlAccessType.FIELD)
 public class RoutingSlipType extends ProcessorType<ProcessorType> {
-    public static final String ROUTING_SLIP_HEADER = "routingSlipHeader";
     public static final String DEFAULT_DELIMITER = ",";
 
     @XmlAttribute
@@ -44,7 +43,7 @@
     private String uriDelimiter;
 
     public RoutingSlipType() {
-        this(ROUTING_SLIP_HEADER, DEFAULT_DELIMITER);
+        this(null, DEFAULT_DELIMITER);
     }
 
     public RoutingSlipType(String headerName) {
@@ -68,7 +67,8 @@
 
     @Override
     public Processor createProcessor(RouteContext routeContext) throws Exception {
-        ObjectHelper.notNull(getHeaderName(), "headerName");
+        ObjectHelper.notEmpty(getHeaderName(), "headerName", this);
+        ObjectHelper.notEmpty(getUriDelimiter(), "uriDelimiter", this);
         return new RoutingSlip(getHeaderName(), getUriDelimiter());
     }
 

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java?rev=736301&r1=736300&r2=736301&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java Wed Jan
21 04:46:35 2009
@@ -21,17 +21,14 @@
 import org.apache.camel.Message;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
-import org.apache.camel.ProducerTemplate;
 import org.apache.camel.impl.ProducerCache;
 import org.apache.camel.impl.ServiceSupport;
 import org.apache.camel.model.RoutingSlipType;
-import org.apache.camel.util.CollectionStringBuffer;
 import org.apache.camel.util.ExchangeHelper;
+import static org.apache.camel.util.ObjectHelper.notNull;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import static org.apache.camel.util.ObjectHelper.notNull;
-
 /**
  * Implements a <a href="http://activemq.apache.org/camel/routing-slip.html">Routing
Slip</a>
  * pattern where the list of actual endpoints to send a message exchange to are

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/model/XmlParseTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/model/XmlParseTest.java?rev=736301&r1=736300&r2=736301&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/model/XmlParseTest.java (original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/model/XmlParseTest.java Wed Jan
21 04:46:35 2009
@@ -148,7 +148,7 @@
         RouteType route = assertOneRoute("routingSlip.xml");
         assertFrom(route, "seda:a");
         RoutingSlipType node = assertOneProcessorInstanceOf(RoutingSlipType.class, route);
-        assertEquals(RoutingSlipType.ROUTING_SLIP_HEADER, node.getHeaderName());
+        assertEquals("destinations", node.getHeaderName());
         assertEquals(RoutingSlipType.DEFAULT_DELIMITER, node.getUriDelimiter());
     }
 

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/routingslip/RoutingSlipTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/routingslip/RoutingSlipTest.java?rev=736301&r1=736300&r2=736301&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/routingslip/RoutingSlipTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/routingslip/RoutingSlipTest.java
Wed Jan 21 04:46:35 2009
@@ -23,7 +23,7 @@
 public class RoutingSlipTest extends ContextTestSupport {
 
     protected static final String ANSWER = "answer";
-    protected static final String ROUTING_SLIP_HEADER = "routingSlipHeader";
+    protected static final String ROUTING_SLIP_HEADER = "myHeader";
 
     public void testUpdatingOfRoutingSlipAllDefaults()
         throws Exception {
@@ -118,7 +118,7 @@
         return new RouteBuilder() {
             public void configure() {
                 // START SNIPPET: e1
-                from("direct:a").routingSlip().to("mock:end");
+                from("direct:a").routingSlip("myHeader").to("mock:end");
                 // END SNIPPET: e1
 
                 // START SNIPPET: e2

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/routingslip/RoutingSlipWithExceptionTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/routingslip/RoutingSlipWithExceptionTest.java?rev=736301&r1=736300&r2=736301&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/routingslip/RoutingSlipWithExceptionTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/routingslip/RoutingSlipWithExceptionTest.java
Wed Jan 21 04:46:35 2009
@@ -30,7 +30,7 @@
 public class RoutingSlipWithExceptionTest extends ContextTestSupport {
 
     protected static final String ANSWER = "answer";
-    protected static final String ROUTING_SLIP_HEADER = "routingSlipHeader";
+    protected static final String ROUTING_SLIP_HEADER = "destinations";
     protected MyBean myBean = new MyBean();
     private MockEndpoint endEndpoint;
     private MockEndpoint exceptionEndpoint;
@@ -141,7 +141,7 @@
             public void configure() {
                 from("direct:start").
                     tryBlock().
-                        routingSlip().to("mock:noexception").
+                        routingSlip(ROUTING_SLIP_HEADER).to("mock:noexception").
                         handle(Exception.class).
                     to("mock:exception");
             }

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/routingslip/RoutingSlipWithNonStandardExchangeTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/routingslip/RoutingSlipWithNonStandardExchangeTest.java?rev=736301&r1=736300&r2=736301&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/routingslip/RoutingSlipWithNonStandardExchangeTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/routingslip/RoutingSlipWithNonStandardExchangeTest.java
Wed Jan 21 04:46:35 2009
@@ -28,7 +28,7 @@
 public class RoutingSlipWithNonStandardExchangeTest extends ContextTestSupport {
 
     protected static final String ANSWER = "answer";
-    protected static final String ROUTING_SLIP_HEADER = "routingSlipHeader";
+    protected static final String ROUTING_SLIP_HEADER = "myDestinations";
     
     public void testRoutingSlipPreservesDifferentExchange()
         throws Exception {
@@ -57,7 +57,7 @@
         return new RouteBuilder() {
             public void configure() {    
                 // START SNIPPET: e1
-                from("direct:a").routingSlip();
+                from("direct:a").routingSlip("myDestinations");
                 // END SNIPPET: e1
             }
         };

Modified: camel/trunk/camel-core/src/test/resources/org/apache/camel/model/routingSlip.xml
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/resources/org/apache/camel/model/routingSlip.xml?rev=736301&r1=736300&r2=736301&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/resources/org/apache/camel/model/routingSlip.xml (original)
+++ camel/trunk/camel-core/src/test/resources/org/apache/camel/model/routingSlip.xml Wed Jan
21 04:46:35 2009
@@ -18,6 +18,6 @@
 <routes id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
   <route>
     <from uri="seda:a"/>
-    <routingSlip/>
+    <routingSlip headerName="destinations"/>
   </route>
 </routes>

Modified: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/routingSlip.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/routingSlip.xml?rev=736301&r1=736300&r2=736301&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/routingSlip.xml
(original)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/routingSlip.xml
Wed Jan 21 04:46:35 2009
@@ -23,7 +23,7 @@
     ">
 
   <!--
-    from("direct:a").routingSlip().to("mock:end");
+    from("direct:a").routingSlip("myHeader").to("mock:end");
     from("direct:b").routingSlip("aRoutingSlipHeader");
     from("direct:c").routingSlip("aRoutingSlipHeader", "#");
   -->
@@ -31,7 +31,7 @@
     xmlns="http://activemq.apache.org/camel/schema/spring">
     <route>
       <from uri="direct:a" />
-      <routingSlip />
+      <routingSlip headerName="myHeader"/>
       <to uri="mock:end" />
     </route>
     <route>



Mime
View raw message