activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r520915 - in /activemq/camel/trunk/camel-xbean/src: main/java/org/apache/camel/spring/ main/resources/META-INF/ main/resources/META-INF/services/ main/resources/org/ main/resources/org/apache/ main/resources/org/apache/camel/ main/resources...
Date Wed, 21 Mar 2007 15:31:00 GMT
Author: chirino
Date: Wed Mar 21 08:30:58 2007
New Revision: 520915

URL: http://svn.apache.org/viewvc?view=rev&rev=520915
Log:
Started working on a CamelNamespaceHandler for spring.


Added:
    activemq/camel/trunk/camel-xbean/src/main/java/org/apache/camel/spring/
    activemq/camel/trunk/camel-xbean/src/main/java/org/apache/camel/spring/CamelBeanDefinitionParser.java
    activemq/camel/trunk/camel-xbean/src/main/java/org/apache/camel/spring/CamelNamespaceHandler.java
    activemq/camel/trunk/camel-xbean/src/main/java/org/apache/camel/spring/RouteBuilderAction.java
    activemq/camel/trunk/camel-xbean/src/main/java/org/apache/camel/spring/RouteBuilderFactory.java
    activemq/camel/trunk/camel-xbean/src/main/java/org/apache/camel/spring/RouteBuilderStatement.java
    activemq/camel/trunk/camel-xbean/src/main/resources/META-INF/spring.handlers
    activemq/camel/trunk/camel-xbean/src/main/resources/META-INF/spring.schemas
    activemq/camel/trunk/camel-xbean/src/main/resources/org/
    activemq/camel/trunk/camel-xbean/src/main/resources/org/apache/
    activemq/camel/trunk/camel-xbean/src/main/resources/org/apache/camel/
    activemq/camel/trunk/camel-xbean/src/main/resources/org/apache/camel/spring/
    activemq/camel/trunk/camel-xbean/src/main/resources/org/apache/camel/spring/camel-1.0.xsd
    activemq/camel/trunk/camel-xbean/src/test/ide-resources/
    activemq/camel/trunk/camel-xbean/src/test/ide-resources/log4j.properties
    activemq/camel/trunk/camel-xbean/src/test/java/org/apache/camel/spring/
    activemq/camel/trunk/camel-xbean/src/test/java/org/apache/camel/spring/SpringXMLExtensionTest.java
    activemq/camel/trunk/camel-xbean/src/test/resources/org/apache/camel/spring/
    activemq/camel/trunk/camel-xbean/src/test/resources/org/apache/camel/spring/spring_xml_extension_test.xml
Removed:
    activemq/camel/trunk/camel-xbean/src/main/resources/META-INF/services/
Modified:
    activemq/camel/trunk/camel-xbean/src/test/resources/org/apache/camel/xbean/xbean_route_builder_test.xml

Added: activemq/camel/trunk/camel-xbean/src/main/java/org/apache/camel/spring/CamelBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-xbean/src/main/java/org/apache/camel/spring/CamelBeanDefinitionParser.java?view=auto&rev=520915
==============================================================================
--- activemq/camel/trunk/camel-xbean/src/main/java/org/apache/camel/spring/CamelBeanDefinitionParser.java
(added)
+++ activemq/camel/trunk/camel-xbean/src/main/java/org/apache/camel/spring/CamelBeanDefinitionParser.java
Wed Mar 21 08:30:58 2007
@@ -0,0 +1,65 @@
+package org.apache.camel.spring;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.springframework.beans.factory.support.AbstractBeanDefinition;
+import org.springframework.beans.factory.support.BeanDefinitionBuilder;
+import org.springframework.beans.factory.xml.AbstractBeanDefinitionParser;
+import org.springframework.beans.factory.xml.ParserContext;
+import org.springframework.util.xml.DomUtils;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class CamelBeanDefinitionParser extends AbstractBeanDefinitionParser {
+
+	protected AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext)
{
+		BeanDefinitionBuilder factory = BeanDefinitionBuilder.rootBeanDefinition(RouteBuilderFactory.class);
+		
+		List childElements = DomUtils.getChildElementsByTagName(element, "route");
+		ArrayList<RouteBuilderStatement> routes = new ArrayList<RouteBuilderStatement>(childElements.size());
+
+		if (childElements != null && childElements.size() > 0) {
+			for (int i = 0; i < childElements.size(); ++i) {
+				Element routeElement = (Element) childElements.get(i);
+				RouteBuilderStatement def = parseRouteElement(routeElement);
+				routes.add(def);
+			}
+		}
+
+		factory.addPropertyValue("routes", routes);
+		return factory.getBeanDefinition();
+	}
+
+	/** 
+	 * Use reflection to figure out what is the valid next element.
+	 * 
+	 * @param routeElement
+	 * @return
+	 */
+	private RouteBuilderStatement parseRouteElement(Element element) {
+		RouteBuilderStatement rc = new RouteBuilderStatement();
+		Class currentBuilder = RouteBuilder.class;
+		
+		NodeList childElements = element.getChildNodes();
+		ArrayList<RouteBuilderAction> actions = new ArrayList<RouteBuilderAction>(childElements.getLength());
+		if (childElements != null && childElements.getLength() > 0) {
+			for (int i = 0; i < childElements.getLength(); ++i) {
+				Node node = childElements.item(i);
+				if( node.getNodeType() == Node.ELEMENT_NODE ) {
+					currentBuilder = parseAction(currentBuilder, actions, (Element)node);
+				}
+			}
+		}
+		
+		return rc;
+	}
+
+	private Class parseAction(Class currentBuilder, ArrayList<RouteBuilderAction> actions,
Element element) {
+		actions.add( new RouteBuilderAction(element.getNodeName()) );
+		return currentBuilder;
+	}
+
+}

Added: activemq/camel/trunk/camel-xbean/src/main/java/org/apache/camel/spring/CamelNamespaceHandler.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-xbean/src/main/java/org/apache/camel/spring/CamelNamespaceHandler.java?view=auto&rev=520915
==============================================================================
--- activemq/camel/trunk/camel-xbean/src/main/java/org/apache/camel/spring/CamelNamespaceHandler.java
(added)
+++ activemq/camel/trunk/camel-xbean/src/main/java/org/apache/camel/spring/CamelNamespaceHandler.java
Wed Mar 21 08:30:58 2007
@@ -0,0 +1,11 @@
+package org.apache.camel.spring;
+
+import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
+
+public class CamelNamespaceHandler extends NamespaceHandlerSupport {
+
+	public void init() {
+		 registerBeanDefinitionParser("routeBuilder", new CamelBeanDefinitionParser());    
+	}
+
+}

Added: activemq/camel/trunk/camel-xbean/src/main/java/org/apache/camel/spring/RouteBuilderAction.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-xbean/src/main/java/org/apache/camel/spring/RouteBuilderAction.java?view=auto&rev=520915
==============================================================================
--- activemq/camel/trunk/camel-xbean/src/main/java/org/apache/camel/spring/RouteBuilderAction.java
(added)
+++ activemq/camel/trunk/camel-xbean/src/main/java/org/apache/camel/spring/RouteBuilderAction.java
Wed Mar 21 08:30:58 2007
@@ -0,0 +1,17 @@
+package org.apache.camel.spring;
+
+import org.apache.camel.builder.RouteBuilder;
+
+public class RouteBuilderAction {
+
+	private final String name;
+
+	public RouteBuilderAction(String name) {
+		this.name = name;
+	}
+
+	public void create(RouteBuilder builder) {
+		// TODO Auto-generated method stub
+		
+	}
+}

Added: activemq/camel/trunk/camel-xbean/src/main/java/org/apache/camel/spring/RouteBuilderFactory.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-xbean/src/main/java/org/apache/camel/spring/RouteBuilderFactory.java?view=auto&rev=520915
==============================================================================
--- activemq/camel/trunk/camel-xbean/src/main/java/org/apache/camel/spring/RouteBuilderFactory.java
(added)
+++ activemq/camel/trunk/camel-xbean/src/main/java/org/apache/camel/spring/RouteBuilderFactory.java
Wed Mar 21 08:30:58 2007
@@ -0,0 +1,55 @@
+package org.apache.camel.spring;
+
+import java.util.ArrayList;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.springframework.beans.factory.FactoryBean;
+
+public class RouteBuilderFactory implements FactoryBean {
+	private ArrayList<RouteBuilderStatement> routes;
+	private boolean singleton;
+
+	class SpringRouteBuilder extends RouteBuilder {
+		private ArrayList<RouteBuilderStatement> routes;
+
+		@Override
+		public void configure() {
+			for (RouteBuilderStatement routeFactory : routes) {
+				routeFactory.create(this);
+			}
+		}
+
+		public ArrayList<RouteBuilderStatement> getRoutes() {
+			return routes;
+		}
+		public void setRoutes(ArrayList<RouteBuilderStatement> routes) {
+			this.routes = routes;
+		}
+	}
+	
+	public Object getObject() throws Exception {
+		SpringRouteBuilder builder = new SpringRouteBuilder();
+		builder.setRoutes(routes);
+		return builder;
+	}
+
+	public Class getObjectType() {
+		return SpringRouteBuilder.class;
+	}
+
+	public boolean isSingleton() {
+		return singleton;
+	}
+	public void setSingleton(boolean singleton) {
+		this.singleton = singleton;
+	}
+
+	public ArrayList<RouteBuilderStatement> getRoutes() {
+		return routes;
+	}
+	public void setRoutes(ArrayList<RouteBuilderStatement> routes) {
+		this.routes = routes;
+	}
+
+
+}

Added: activemq/camel/trunk/camel-xbean/src/main/java/org/apache/camel/spring/RouteBuilderStatement.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-xbean/src/main/java/org/apache/camel/spring/RouteBuilderStatement.java?view=auto&rev=520915
==============================================================================
--- activemq/camel/trunk/camel-xbean/src/main/java/org/apache/camel/spring/RouteBuilderStatement.java
(added)
+++ activemq/camel/trunk/camel-xbean/src/main/java/org/apache/camel/spring/RouteBuilderStatement.java
Wed Mar 21 08:30:58 2007
@@ -0,0 +1,11 @@
+package org.apache.camel.spring;
+
+import org.apache.camel.builder.RouteBuilder;
+
+public class RouteBuilderStatement {
+
+	public void create(RouteBuilder builder) {
+		// TODO Auto-generated method stub
+		
+	}
+}

Added: activemq/camel/trunk/camel-xbean/src/main/resources/META-INF/spring.handlers
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-xbean/src/main/resources/META-INF/spring.handlers?view=auto&rev=520915
==============================================================================
--- activemq/camel/trunk/camel-xbean/src/main/resources/META-INF/spring.handlers (added)
+++ activemq/camel/trunk/camel-xbean/src/main/resources/META-INF/spring.handlers Wed Mar 21
08:30:58 2007
@@ -0,0 +1 @@
+http\://activemq.apache.org/camel/schema/camel-1.0.xsd=org.apache.camel.spring.CamelNamespaceHandler
\ No newline at end of file

Added: activemq/camel/trunk/camel-xbean/src/main/resources/META-INF/spring.schemas
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-xbean/src/main/resources/META-INF/spring.schemas?view=auto&rev=520915
==============================================================================
--- activemq/camel/trunk/camel-xbean/src/main/resources/META-INF/spring.schemas (added)
+++ activemq/camel/trunk/camel-xbean/src/main/resources/META-INF/spring.schemas Wed Mar 21
08:30:58 2007
@@ -0,0 +1 @@
+http\://activemq.apache.org/camel/schema/camel-1.0.xsd=org/apache/camel/spring/camel-1.0.xsd
\ No newline at end of file

Added: activemq/camel/trunk/camel-xbean/src/main/resources/org/apache/camel/spring/camel-1.0.xsd
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-xbean/src/main/resources/org/apache/camel/spring/camel-1.0.xsd?view=auto&rev=520915
==============================================================================
--- activemq/camel/trunk/camel-xbean/src/main/resources/org/apache/camel/spring/camel-1.0.xsd
(added)
+++ activemq/camel/trunk/camel-xbean/src/main/resources/org/apache/camel/spring/camel-1.0.xsd
Wed Mar 21 08:30:58 2007
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema 
+  xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+  elementFormDefault="qualified" 
+  attributeFormDefault="unqualified"
+  targetNamespace="http://activemq.apache.org/camel/schema/camel-1.0.xsd" 
+  xmlns:c="http://activemq.apache.org/camel/schema/camel-1.0.xsd"
+  xmlns:s="http://www.springframework.org/schema/beans"
+  >
+ 
+  <xs:import namespace="http://www.springframework.org/schema/beans"/>
+
+  <xs:element name="routeBuilder">
+    <xs:complexType>
+      <xs:complexContent>
+          <xs:extension base="s:identifiedType">
+		      <xs:sequence>
+		        <xs:element maxOccurs="unbounded" ref="c:route"/>
+		      </xs:sequence>
+	      </xs:extension>
+  	  </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="route">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="c:from"/>
+        <xs:element minOccurs="0" ref="c:choice"/>
+        <xs:choice minOccurs="0">
+          <xs:element ref="c:filter"/>
+          <xs:element ref="c:intercept"/>
+        </xs:choice>
+        <xs:choice minOccurs="0">
+          <xs:element ref="c:to"/>
+          <xs:element ref="c:processor"/>
+        </xs:choice>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="from">
+    <xs:complexType>
+      <xs:attribute name="uri" use="required" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="choice">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="c:when"/>
+        <xs:element ref="c:otherwise"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="when">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="c:predicate">
+          <xs:sequence>
+            <xs:element ref="c:to"/>
+          </xs:sequence>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="otherwise">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="c:to"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="filter" type="c:predicate"/>
+  <xs:element name="intercept">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="s:bean"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="processor">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="s:bean"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:complexType name="predicate">
+    <xs:sequence>
+      <xs:element ref="c:predicate"/>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:element name="predicate">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="c:header"/>
+        <xs:element ref="c:equalTo"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="header">
+    <xs:complexType>
+      <xs:attribute name="name" use="required" type="xs:NCName"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="equalTo">
+    <xs:complexType>
+      <xs:attribute name="value" use="required" type="xs:NCName"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="to">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="c:uri"/>
+      </xs:sequence>
+      <xs:attribute name="uri" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="uri" type="xs:NMTOKEN"/>
+</xs:schema>

Added: activemq/camel/trunk/camel-xbean/src/test/ide-resources/log4j.properties
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-xbean/src/test/ide-resources/log4j.properties?view=auto&rev=520915
==============================================================================
--- activemq/camel/trunk/camel-xbean/src/test/ide-resources/log4j.properties (added)
+++ activemq/camel/trunk/camel-xbean/src/test/ide-resources/log4j.properties Wed Mar 21 08:30:58
2007
@@ -0,0 +1,31 @@
+## ------------------------------------------------------------------------
+## 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.
+## ------------------------------------------------------------------------
+
+#
+# The logging properties used for eclipse testing, We want to see debug output on the console.
+#
+log4j.rootLogger=INFO, out
+
+#log4j.logger.org.apache.activemq=DEBUG
+log4j.logger.org.apache.camel=DEBUG
+log4j.logger.org.springframework=DEBUG
+
+# CONSOLE appender not used by default
+log4j.appender.out=org.apache.log4j.ConsoleAppender
+log4j.appender.out.layout=org.apache.log4j.PatternLayout
+log4j.appender.out.layout.ConversionPattern=[%30.30t] %-30.30c{1} %-5p %m%n
+#log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n

Added: activemq/camel/trunk/camel-xbean/src/test/java/org/apache/camel/spring/SpringXMLExtensionTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-xbean/src/test/java/org/apache/camel/spring/SpringXMLExtensionTest.java?view=auto&rev=520915
==============================================================================
--- activemq/camel/trunk/camel-xbean/src/test/java/org/apache/camel/spring/SpringXMLExtensionTest.java
(added)
+++ activemq/camel/trunk/camel-xbean/src/test/java/org/apache/camel/spring/SpringXMLExtensionTest.java
Wed Mar 21 08:30:58 2007
@@ -0,0 +1,45 @@
+/*
+ * 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 org.apache.camel.builder.RouteBuilder;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+import junit.framework.TestCase;
+
+/**
+ * @version $Revision: 520164 $
+ */
+public class SpringXMLExtensionTest extends TestCase {
+	
+	private ClassPathXmlApplicationContext ctx;
+
+	@Override
+	protected void setUp() throws Exception {
+		ctx = new ClassPathXmlApplicationContext("org/apache/camel/spring/spring_xml_extension_test.xml");
+	}
+
+	@Override
+	protected void tearDown() throws Exception {
+		ctx.close();
+	}
+	
+	public void testSimpleRoute() {
+		RouteBuilder builder = (RouteBuilder) ctx.getBean("testSimpleRoute");
+		assertNotNull(builder);
+	}
+}

Added: activemq/camel/trunk/camel-xbean/src/test/resources/org/apache/camel/spring/spring_xml_extension_test.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-xbean/src/test/resources/org/apache/camel/spring/spring_xml_extension_test.xml?view=auto&rev=520915
==============================================================================
--- activemq/camel/trunk/camel-xbean/src/test/resources/org/apache/camel/spring/spring_xml_extension_test.xml
(added)
+++ activemq/camel/trunk/camel-xbean/src/test/resources/org/apache/camel/spring/spring_xml_extension_test.xml
Wed Mar 21 08:30:58 2007
@@ -0,0 +1,36 @@
+<?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:c="http://activemq.apache.org/camel/schema/camel-1.0.xsd"
+      xsi:schemaLocation="
+         http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+         http://activemq.apache.org/camel/schema/camel-1.0.xsd http://activemq.apache.org/camel/schema/camel-1.0.xsd">
+
+    <c:routeBuilder id="testSimpleRoute">
+       <c:route>
+         <c:from uri="queue:a"/>
+         <c:to uri="queue:b"/>
+       </c:route>
+       <c:route>
+         <c:from uri="queue:c"/>
+         <c:to uri="queue:d"/>
+       </c:route>
+    </c:routeBuilder>
+
+</beans>
\ No newline at end of file

Modified: activemq/camel/trunk/camel-xbean/src/test/resources/org/apache/camel/xbean/xbean_route_builder_test.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-xbean/src/test/resources/org/apache/camel/xbean/xbean_route_builder_test.xml?view=diff&rev=520915&r1=520914&r2=520915
==============================================================================
--- activemq/camel/trunk/camel-xbean/src/test/resources/org/apache/camel/xbean/xbean_route_builder_test.xml
(original)
+++ activemq/camel/trunk/camel-xbean/src/test/resources/org/apache/camel/xbean/xbean_route_builder_test.xml
Wed Mar 21 08:30:58 2007
@@ -15,14 +15,14 @@
     See the License for the specific language governing permissions and
     limitations under the License.
 -->
-<beans>
+<s:beans xmlns="http://activemq.apache.org/camel/schema/camel-1.0.xsd" xmlns:s="http://www.springframework.org/schema/beans">
     <!-- Right now this is just ideas of what we wish the xml could look like -->
 
     <!-- 
         from("queue:a").to("queue:b");
         from("queue:c").to("queue:d");
      -->
-    <RouteBuilder id="buildSimpleRoute">
+    <routeBuilder id="buildSimpleRoute" >
        <route>
          <from uri="queue:a"/>
          <to uri="queue:b"/>
@@ -31,25 +31,25 @@
          <from uri="queue:c"/>
          <to uri="queue:d"/>
        </route>
-    </RouteBuilder>
+    </routeBuilder>
     
     <!-- 
         from("queue:a").process(myProcessor);
      -->
-    <RouteBuilder id="buildCustomProcessor">
+    <routeBuilder id="buildCustomProcessor">
        <route>
          <from uri="queue:a"/>
          <processor>
-           <bean id="myProcessor" class="some.Processor"/>
+           <s:bean id="myProcessor" class="some.Processor"/>
          </processor>
        </route>
-    </RouteBuilder>
+    </routeBuilder>
 
 
     <!-- 
         from("queue:a").filter(headerEquals("foo", "bar")).process(myProcessor);
      -->
-    <RouteBuilder id="buildCustomProcessorWithFilter">
+    <routeBuilder id="buildCustomProcessorWithFilter">
        <route>
          <from uri="queue:a"/>
          <filter>
@@ -59,10 +59,10 @@
              </predicate>
          </filter>
          <processor>
-           <bean class="some.Processor"/>
+           <s:bean class="some.Processor"/>
          </processor>
        </route>
-    </RouteBuilder>
+    </routeBuilder>
 
     <!-- 
         from("queue:a")
@@ -71,16 +71,16 @@
               .add(interceptor2)
            .target().to("queue:d");
      -->
-    <RouteBuilder id="buildRouteWithInterceptor">
+    <routeBuilder id="buildRouteWithInterceptor">
        <route>
          <from uri="queue:a"/>
          <intercept>
-             <bean id="interceptor1" class="some.InterceptorProcessor"/>
-             <bean id="interceptor2" class="some.InterceptorProcessor"/>
+             <s:bean id="interceptor1" class="some.InterceptorProcessor"/>
+             <s:bean id="interceptor2" class="some.InterceptorProcessor"/>
          </intercept>
          <to uri="queue:b"/>
        </route>
-    </RouteBuilder>
+    </routeBuilder>
 
     <!-- 
         from("queue:a").choice()
@@ -117,7 +117,7 @@
     <!-- 
         from("queue:a").filter(headerEquals("foo", "bar")).to("queue:b");
      -->
-    <RouteBuilder id="buildSimpleRouteWithHeaderPredicate">
+    <routeBuilder id="buildSimpleRouteWithHeaderPredicate">
        <route>
          <from uri="queue:a"/>
          <filter>
@@ -128,12 +128,12 @@
          </filter>
          <to uri="queue:b"/>
        </route>
-    </RouteBuilder>
+    </routeBuilder>
 
     <!-- 
         from("queue:a").to("queue:tap", "queue:b");
      -->
-    <RouteBuilder id="buildWireTap">
+    <routeBuilder id="buildWireTap">
        <route>
          <from uri="queue:a"/>
          <to>
@@ -141,7 +141,7 @@
             <uri>queue:a</uri>
          </to>
        </route>
-    </RouteBuilder>
+    </routeBuilder>
 
-</beans>
+</s:beans>
 <!-- END SNIPPET: example -->



Mime
View raw message