svn commit: r734938 - in /activemq/camel/trunk: camel-core/src/main/java/org/apache/camel/model/DelayerType.java components/camel-spring/src/test/resources/org/apache/camel/spring/processor/delayer.xml

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r734938 - in /activemq/camel/trunk: camel-core/src/main/java/org/apache/camel/model/DelayerType.java components/camel-spring/src/test/resources/org/apache/camel/spring/processor/delayer.xml

davsclaus-2
Author: davsclaus
Date: Fri Jan 16 00:43:32 2009
New Revision: 734938

URL: http://svn.apache.org/viewvc?rev=734938&view=rev
Log:
CAMEL-1264: Delayer in Spring DSL now uses an attribute for delayTime.

Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/DelayerType.java
    activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/delayer.xml

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/DelayerType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/DelayerType.java?rev=734938&r1=734937&r2=734938&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/DelayerType.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/DelayerType.java Fri Jan 16 00:43:32 2009
@@ -18,7 +18,7 @@
 
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlRootElement;
 
 import org.apache.camel.Expression;
@@ -37,7 +37,7 @@
 @XmlRootElement(name = "delay")
 @XmlAccessorType(XmlAccessType.FIELD)
 public class DelayerType extends ExpressionNode {
-    @XmlElement
+    @XmlAttribute
     private Long delayTime = 0L;
 
     public DelayerType() {
@@ -51,19 +51,24 @@
         super(processAtExpression);
     }
 
-    public DelayerType(Expression processAtExpression, long delay) {
+    public DelayerType(Expression processAtExpression, long delayTime) {
         super(processAtExpression);
-        this.delayTime = delay;
+        this.delayTime = delayTime;
     }
 
     @Override
     public String toString() {
-        return "Delayer[" + getExpression() + " -> " + getOutputs() + "]";
+        return "Delayer[on: " + getExpression() + " delay: " + delayTime + " -> " + getOutputs() + "]";
     }
     
     // Fluent API
     // -------------------------------------------------------------------------
-    
+
+    /**
+     * Sets the delay time in millis to delay
+     * @param delay delay time in millis
+     * @return the builder
+     */
     public DelayerType delayTime(Long delay) {
         setDelayTime(delay);
         return this;
@@ -86,8 +91,8 @@
         return delayTime;
     }
 
-    public void setDelayTime(Long delay) {
-        this.delayTime = delay;
+    public void setDelayTime(Long delayTime) {
+        this.delayTime = delayTime;
     }  
     
 

Modified: activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/delayer.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/delayer.xml?rev=734938&r1=734937&r2=734938&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/delayer.xml (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/delayer.xml Fri Jan 16 00:43:32 2009
@@ -21,30 +21,27 @@
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
        http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
     ">
-  <!--
-      from("seda:a").delayer(header("JMSTimestamp"), 3000).to("mock:result");
-      from("seda:b").delayer(3000).to("mock:result");
-  -->
-  <!-- START SNIPPET: example -->
-  <camelContext id="camel"
-    xmlns="http://activemq.apache.org/camel/schema/spring">
-    <route>
-      <from uri="seda:a"/>
-      <delay>      
-        <simple>header.JMSTimestamp</simple>
-        <delayTime>3000</delayTime>
-      </delay>
-      <to uri="mock:result"/>
-    </route>
-    <route>
-      <from uri="seda:b"/>
-      <delay>
-        <language/>  
-        <delayTime>3000</delayTime>
-      </delay>
-      <to uri="mock:result"/>
-    </route>
-  </camelContext>
-  <!-- END SNIPPET: example -->
+    <!--
+        from("seda:a").delayer(header("JMSTimestamp"), 3000).to("mock:result");
+        from("seda:b").delayer(3000).to("mock:result");
+    -->
+    <!-- START SNIPPET: example -->
+    <camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
+        <route>
+            <from uri="seda:a"/>
+            <delay delayTime="3000">
+                <simple>header.JMSTimestamp</simple>
+            </delay>
+            <to uri="mock:result"/>
+        </route>
+        <route>
+            <from uri="seda:b"/>
+            <delay delayTime="3000">
+                <language/>
+            </delay>
+            <to uri="mock:result"/>
+        </route>
+    </camelContext>
+    <!-- END SNIPPET: example -->
 
 </beans>