activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r521425 - in /activemq/camel/trunk: camel-core/src/main/java/org/apache/camel/builder/ camel-spring/src/main/resources/org/apache/camel/spring/ camel-spring/src/test/java/org/apache/camel/spring/builder/ camel-spring/src/test/resources/org/...
Date Thu, 22 Mar 2007 19:53:45 GMT
Author: chirino
Date: Thu Mar 22 12:53:44 2007
New Revision: 521425

URL: http://svn.apache.org/viewvc?view=rev&rev=521425
Log:
Got the dynamic receipient list example workin in spring xml

Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/FromBuilder.java
    activemq/camel/trunk/camel-spring/src/main/resources/org/apache/camel/spring/camel-1.0.xsd
    activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/builder/SpringRouteBuilderTest.java
    activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/builder/spring_route_builder_test.xml
    activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/examples.xml

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/FromBuilder.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/FromBuilder.java?view=diff&rev=521425&r1=521424&r2=521425
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/FromBuilder.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/FromBuilder.java
Thu Mar 22 12:53:44 2007
@@ -167,7 +167,9 @@
      * @param receipients is the builder of the expression used in the {@link RecipientList}
to decide the destinations
      */
     @Fluent
-    public RecipientListBuilder<E> recipientList(@FluentArg("receipients") ValueBuilder<E>
receipients) {
+    public RecipientListBuilder<E> recipientList(
+    		@FluentArg(value="recipients",element=true) 
+    		ValueBuilder<E> receipients) {
         RecipientListBuilder<E> answer = new RecipientListBuilder<E>(this, receipients);
         addProcessBuilder(answer);
         return answer;

Modified: activemq/camel/trunk/camel-spring/src/main/resources/org/apache/camel/spring/camel-1.0.xsd
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/main/resources/org/apache/camel/spring/camel-1.0.xsd?view=diff&rev=521425&r1=521424&r2=521425
==============================================================================
--- activemq/camel/trunk/camel-spring/src/main/resources/org/apache/camel/spring/camel-1.0.xsd
(original)
+++ activemq/camel/trunk/camel-spring/src/main/resources/org/apache/camel/spring/camel-1.0.xsd
Thu Mar 22 12:53:44 2007
@@ -25,12 +25,15 @@
     <xs:complexType>
       <xs:sequence>
         <xs:element ref="c:from"/>
-        <xs:element minOccurs="0" maxOccurs="unbounded" ref="c:intercept"/>
-        <xs:element minOccurs="0" ref="c:choice"/>
-        <xs:element minOccurs="0" maxOccurs="unbounded" ref="c:filter"/>
-        <xs:choice minOccurs="0">
+        <xs:choice>
+          <xs:element minOccurs="0" maxOccurs="unbounded" ref="c:filter"/>
+          <xs:element minOccurs="0" maxOccurs="unbounded" ref="c:intercept"/>
+        </xs:choice>
+        <xs:choice>
           <xs:element ref="c:to"/>
+          <xs:element ref="c:choice"/>
           <xs:element ref="c:process"/>
+          <xs:element ref="c:recipientList"/>
         </xs:choice>
       </xs:sequence>
     </xs:complexType>
@@ -43,6 +46,7 @@
       <xs:attribute name="uris" type="xs:NMTOKEN"/>
     </xs:complexType>
   </xs:element>
+  <xs:element name="filter" type="c:predicate"/>
   <xs:element name="intercept">
     <xs:complexType>
       <xs:sequence>
@@ -81,12 +85,26 @@
       </xs:sequence>
     </xs:complexType>
   </xs:element>
-  <xs:element name="filter" type="c:predicate"/>
   <xs:element name="process">
     <xs:complexType>
       <xs:attribute name="ref" use="required"/>
     </xs:complexType>
   </xs:element>
+  <xs:element name="recipientList">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="c:recipients"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="recipients">
+    <xs:complexType>
+      <xs:choice>
+        <xs:element ref="c:body"/>
+        <xs:element ref="c:header"/>
+      </xs:choice>
+    </xs:complexType>
+  </xs:element>
   <xs:complexType name="predicate">
     <xs:sequence>
       <xs:element ref="c:predicate"/>
@@ -95,17 +113,23 @@
   <xs:element name="predicate">
     <xs:complexType>
       <xs:sequence>
-        <xs:element ref="c:header"/>
-        <xs:element ref="c:isEqualTo"/>
+        <xs:choice>
+          <xs:element ref="c:body"/>
+          <xs:element ref="c:header"/>
+        </xs:choice>
+        <xs:choice>
+          <xs:element ref="c:isEqualTo"/>
+          <xs:element ref="c:isNotEqualTo"/>
+        </xs:choice>
       </xs:sequence>
     </xs:complexType>
   </xs:element>
-  <xs:element name="header">
+  <xs:element name="isEqualTo">
     <xs:complexType>
-      <xs:attribute name="name" use="required" type="xs:NCName"/>
+      <xs:attribute name="value" use="required" type="xs:NCName"/>
     </xs:complexType>
   </xs:element>
-  <xs:element name="isEqualTo">
+  <xs:element name="isNotEqualTo">
     <xs:complexType>
       <xs:attribute name="value" use="required" type="xs:NCName"/>
     </xs:complexType>
@@ -122,4 +146,12 @@
     </xs:complexType>
   </xs:element>
   <xs:element name="uri" type="xs:NMTOKEN"/>
+  <xs:element name="header">
+    <xs:complexType>
+      <xs:attribute name="name" use="required"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="body">
+    <xs:complexType/>
+  </xs:element>
 </xs:schema>

Modified: activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/builder/SpringRouteBuilderTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/builder/SpringRouteBuilderTest.java?view=diff&rev=521425&r1=521424&r2=521425
==============================================================================
--- activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/builder/SpringRouteBuilderTest.java
(original)
+++ activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/builder/SpringRouteBuilderTest.java
Thu Mar 22 12:53:44 2007
@@ -98,4 +98,17 @@
 		assertNotNull(builder);
 		return builder;
 	}
+	
+	@Override
+	protected RouteBuilder<Exchange> buildDynamicRecipientList() {
+		RouteBuilder<Exchange> builder = (RouteBuilder<Exchange>) ctx.getBean("buildDynamicRecipientList");
+		assertNotNull(builder);
+		return builder;
+	}
+	
+	@Override
+	protected RouteBuilder<Exchange> buildStaticRecipientList() {
+		// TODO Auto-generated method stub
+		return super.buildStaticRecipientList();
+	}
 }

Modified: activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/builder/spring_route_builder_test.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/builder/spring_route_builder_test.xml?view=diff&rev=521425&r1=521424&r2=521425
==============================================================================
--- activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/builder/spring_route_builder_test.xml
(original)
+++ activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/builder/spring_route_builder_test.xml
Thu Mar 22 12:53:44 2007
@@ -138,6 +138,21 @@
          </to>
        </route>
     </routeBuilder>
+    
+    <!-- 
+        from("queue:a").recipientList(header("foo"));
+     -->
+    <routeBuilder id="buildDynamicRecipientList" xmlns="http://activemq.apache.org/camel/schema/camel-1.0.xsd">
+       <route>
+         <from uri="queue:a"/>
+         <recipientList>
+         	<recipients>
+              <header name="foo"/>
+            </recipients>
+         </recipientList>
+       </route>
+    </routeBuilder>
+    
 
 </beans>
 <!-- END SNIPPET: example -->

Modified: activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/examples.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/examples.xml?view=diff&rev=521425&r1=521424&r2=521425
==============================================================================
--- activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/examples.xml
(original)
+++ activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/examples.xml
Thu Mar 22 12:53:44 2007
@@ -96,7 +96,7 @@
              <when>
                  <predicate>
                     <header name="foo"/>
-                    <isEqualTo value="cheese"/>
+                    <isNotEqualTo value="cheese"/>
                  </predicate>
                  <to endpoint="queue:c"/>
              </when>
@@ -123,6 +123,30 @@
             <uri>queue:tap</uri>
             <uri>queue:a</uri>
          </to>
+       </route>
+       
+       <route>
+         <from uri="queue:a"/>
+         <recipientList>
+         	<recipients>
+              <header name=""/>
+            </recipients>
+         </recipientList>
+       </route>
+       
+       <route>
+         <from uri="queue:a"/>
+         <filter>
+             <predicate>
+                <body/>
+                <isNotEqualTo value="none"/>
+             </predicate>
+         </filter>
+         <recipientList>
+         	<recipients>
+              <body/>
+            </recipients>
+         </recipientList>
        </route>
        
     </routeBuilder>



Mime
View raw message