You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2008/05/10 05:08:13 UTC

svn commit: r655008 - in /activemq/camel/trunk/components/camel-spring-integration: ./ src/main/java/org/apache/camel/component/spring/integration/ src/main/java/org/apache/camel/component/spring/integration/adapter/ src/main/java/org/apache/camel/comp...

Author: ningjiang
Date: Fri May  9 20:08:12 2008
New Revision: 655008

URL: http://svn.apache.org/viewvc?rev=655008&view=rev
Log:
CAMEL-478 added CamelSourceAdpater and CamelTargetAdapter to integrate Camel with SI

Added:
    activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/
    activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/AbstractCamelAdapter.java   (with props)
    activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/CamelSourceAdapter.java   (with props)
    activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/CamelTargetAdapter.java   (with props)
    activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/config/
    activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/config/AbstractCamelContextBeanDefinitionParaser.java   (with props)
    activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/config/CamelSourceAdpaterParser.java   (with props)
    activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/config/CamelTargetAdapterParser.java   (with props)
    activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/config/NamespaceHandler.java   (with props)
    activemq/camel/trunk/components/camel-spring-integration/src/main/resources/META-INF/LICENSE.txt   (with props)
    activemq/camel/trunk/components/camel-spring-integration/src/main/resources/META-INF/NOTICE.txt   (with props)
    activemq/camel/trunk/components/camel-spring-integration/src/main/resources/META-INF/spring.handlers
    activemq/camel/trunk/components/camel-spring-integration/src/main/resources/META-INF/spring.schemas
    activemq/camel/trunk/components/camel-spring-integration/src/main/resources/schema/
    activemq/camel/trunk/components/camel-spring-integration/src/main/resources/schema/camel-spring-integration.xsd   (with props)
    activemq/camel/trunk/components/camel-spring-integration/src/test/java/org/apache/camel/component/spring/integration/adapter/
    activemq/camel/trunk/components/camel-spring-integration/src/test/java/org/apache/camel/component/spring/integration/adapter/CamelSourceAdapterTest.java   (with props)
    activemq/camel/trunk/components/camel-spring-integration/src/test/java/org/apache/camel/component/spring/integration/adapter/CamelTargetAdapterTest.java   (with props)
    activemq/camel/trunk/components/camel-spring-integration/src/test/java/org/apache/camel/component/spring/integration/adapter/ConfigurationTest.java   (with props)
    activemq/camel/trunk/components/camel-spring-integration/src/test/resources/org/apache/camel/component/spring/integration/adapter/
    activemq/camel/trunk/components/camel-spring-integration/src/test/resources/org/apache/camel/component/spring/integration/adapter/CamelSource.xml   (with props)
    activemq/camel/trunk/components/camel-spring-integration/src/test/resources/org/apache/camel/component/spring/integration/adapter/CamelTarget.xml   (with props)
Modified:
    activemq/camel/trunk/components/camel-spring-integration/pom.xml
    activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/SpringIntegrationConsumer.java
    activemq/camel/trunk/components/camel-spring-integration/src/test/java/org/apache/camel/component/spring/integration/HelloWorldService.java
    activemq/camel/trunk/components/camel-spring-integration/src/test/resources/org/apache/camel/component/spring/integration/producer.xml

Modified: activemq/camel/trunk/components/camel-spring-integration/pom.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring-integration/pom.xml?rev=655008&r1=655007&r2=655008&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring-integration/pom.xml (original)
+++ activemq/camel/trunk/components/camel-spring-integration/pom.xml Fri May  9 20:08:12 2008
@@ -13,7 +13,7 @@
 
   <properties>
 	<camel.osgi.export.pkg>org.apache.camel.component.spring.integration.*</camel.osgi.export.pkg>
-    <spring-integration-version>1.0.0.M3</spring-integration-version>
+    <spring-integration-version>1.0.0.CI-126</spring-integration-version>
   </properties>
 
   <version>1.4-SNAPSHOT</version>
@@ -21,9 +21,15 @@
   <repositories>
     <repository>
       <id>spring.maven.milestone</id>
-      <name>Spring Maven Repo</name>
+      <name>Spring Milestone Maven Repo</name>
       <url>http://s3.amazonaws.com/maven.springframework.org/milestone</url>
     </repository>
+
+    <repository>
+      <id>spring.maven.snapshot</id>
+      <name>Spring Snapshot Maven Repo</name>
+      <url>http://s3.amazonaws.com/maven.springframework.org/snapshot</url>
+    </repository>
   </repositories>
 
   <build>
@@ -36,6 +42,27 @@
           <target>1.5</target>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>build-helper-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>attach-artifacts</id>
+            <phase>package</phase>
+            <goals>
+              <goal>attach-artifact</goal>
+            </goals>
+            <configuration>
+              <artifacts>
+                <artifact>
+                  <file>./src/main/resources/schema/camel-spring-integration.xsd</file>
+                  <type>xsd</type>
+                </artifact>
+              </artifacts>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
   <dependencies>
@@ -101,4 +128,6 @@
     </dependency>
   </dependencies>
 
+
+
 </project>
\ No newline at end of file

Modified: activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/SpringIntegrationConsumer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/SpringIntegrationConsumer.java?rev=655008&r1=655007&r2=655008&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/SpringIntegrationConsumer.java (original)
+++ activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/SpringIntegrationConsumer.java Fri May  9 20:08:12 2008
@@ -33,6 +33,7 @@
  * Please specify the inputChannel in the endpoint url for this consumer.
  * If the message pattern is inOut, the outputChannel property
  * should be set for the outgoing message.
+ *
  * @version $Revision$
  */
 public class SpringIntegrationConsumer  extends ScheduledPollConsumer<SpringIntegrationExchange> {

Added: activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/AbstractCamelAdapter.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/AbstractCamelAdapter.java?rev=655008&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/AbstractCamelAdapter.java (added)
+++ activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/AbstractCamelAdapter.java Fri May  9 20:08:12 2008
@@ -0,0 +1,62 @@
+/**
+ * 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.component.spring.integration.adapter;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Consumer;
+import org.apache.camel.Endpoint;
+import org.springframework.integration.handler.MessageHandler;
+
+/**
+ * The Abstract class for the Spring Integration Camel Adapter
+ *
+ * @author Willem Jiang
+ *
+ * @version $Revision$
+ */
+public abstract class AbstractCamelAdapter implements MessageHandler {
+    private CamelContext camelContext;
+    private String camelEndpointUri;
+    private volatile boolean expectReply = true;
+
+    public void setCamelContext(CamelContext context) {
+        camelContext = context;
+    }
+
+    public CamelContext getCamelContext() {
+        return camelContext;
+    }
+
+    public String getCamelEndpointUri() {
+        return camelEndpointUri;
+    }
+
+    public void setCamelEndpointUri(String uri) {
+        camelEndpointUri = uri;
+    }
+
+    public void setExpectReply(boolean expectReply) {
+        this.expectReply = expectReply;
+    }
+
+    public boolean isExpectReply() {
+        return expectReply;
+    }
+
+
+}

Propchange: activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/AbstractCamelAdapter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/AbstractCamelAdapter.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/CamelSourceAdapter.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/CamelSourceAdapter.java?rev=655008&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/CamelSourceAdapter.java (added)
+++ activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/CamelSourceAdapter.java Fri May  9 20:08:12 2008
@@ -0,0 +1,138 @@
+/**
+ * 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.component.spring.integration.adapter;
+
+import org.apache.camel.Consumer;
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.component.spring.integration.SpringIntegrationBinding;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.integration.ConfigurationException;
+import org.springframework.integration.bus.MessageBus;
+import org.springframework.integration.bus.MessageBusAware;
+import org.springframework.integration.channel.MessageChannel;
+import org.springframework.integration.channel.RequestReplyTemplate;
+import org.springframework.integration.message.Message;
+
+/**
+ * A CamelContext will be injected into CameSourceAdapter which will
+ * let Spring Integration channel talk to the CamelContext certain endpoint
+ *
+ * @author Willem Jiang
+ *
+ * @version $Revision$
+ */
+public class CamelSourceAdapter extends AbstractCamelAdapter implements InitializingBean, MessageBusAware {
+    protected final Object lifecycleMonitor = new Object();
+    private final Log logger = LogFactory.getLog(this.getClass());
+    private Consumer consumer;
+    private Endpoint camelEndpoint;
+    private MessageChannel requestChannel;
+    private RequestReplyTemplate requestReplyTemplate = new RequestReplyTemplate();
+
+    private volatile boolean initialized;
+
+    public void setRequestChannel(MessageChannel channel) {
+        requestChannel = channel;
+        requestReplyTemplate.setRequestChannel(requestChannel);
+    }
+
+    public MessageChannel getChannel() {
+        return requestChannel;
+    }
+
+    public void setReplyChannel(MessageChannel channel) {
+        requestReplyTemplate.setReplyChannel(channel);
+    }
+
+    public void setRequestTimeout(long requestTimeout) {
+        this.requestReplyTemplate.setRequestTimeout(requestTimeout);
+    }
+
+    public void setReplyTimeout(long replyTimeout) {
+        this.requestReplyTemplate.setReplyTimeout(replyTimeout);
+    }
+
+    private void incoming(Exchange exchange) {
+        org.springframework.integration.message.Message request =
+            SpringIntegrationBinding.createSpringIntegrationMessage(exchange);
+
+        org.springframework.integration.message.Message response = handle(request);
+        if (response != null) {
+            // TODO How to deal with the fault message
+            SpringIntegrationBinding.storeToCamelMessage(response, exchange.getOut());
+        }
+    }
+
+    protected class ConsumerProcessor implements Processor {
+        public void process(Exchange exchange) {
+            try {
+                incoming(exchange);
+            } catch (Throwable ex) {
+                ex.printStackTrace();
+                logger.warn("Failed to process incoming message : " + ex);
+                //TODO Maybe we should set the exception as the fault message
+            }
+        }
+
+    }
+
+    public final void afterPropertiesSet() throws Exception {
+        synchronized (this.lifecycleMonitor) {
+            if (this.initialized) {
+                return;
+            }
+        }
+        this.initialize();
+        this.initialized = true;
+    }
+
+    protected void initialize() throws Exception {
+        // start the service here
+        camelEndpoint = getCamelContext().getEndpoint(getCamelEndpointUri());
+        consumer = camelEndpoint.createConsumer(new ConsumerProcessor());
+        consumer.start();
+    }
+
+    public final Message<?> handle(Message<?> message) {
+        if (!this.initialized) {
+            try {
+                this.afterPropertiesSet();
+            } catch (Exception e) {
+                throw new ConfigurationException("unable to initialize " + this.getClass().getName(), e);
+            }
+        }
+        if (!isExpectReply()) {
+            boolean sent = this.requestReplyTemplate.send(message);
+            if (!sent && logger.isWarnEnabled()) {
+                logger.warn("failed to send message to channel within timeout");
+            }
+            return null;
+        }
+        return this.requestReplyTemplate.request(message);
+    }
+
+    public void setMessageBus(MessageBus bus) {
+        requestReplyTemplate.setMessageBus(bus);
+    }
+
+
+
+}

Propchange: activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/CamelSourceAdapter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/CamelSourceAdapter.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/CamelTargetAdapter.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/CamelTargetAdapter.java?rev=655008&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/CamelTargetAdapter.java (added)
+++ activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/CamelTargetAdapter.java Fri May  9 20:08:12 2008
@@ -0,0 +1,72 @@
+/**
+ * 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.component.spring.integration.adapter;
+
+import org.apache.camel.CamelTemplate;
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.ExchangePattern;
+import org.apache.camel.component.spring.integration.SpringIntegrationBinding;
+import org.apache.camel.component.spring.integration.SpringIntegrationExchange;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.integration.message.Message;
+
+/**
+ * CamelTargeAdapter will redirect the Spring Integration message to the Camel context.
+ * When we inject the camel context into it, we need also specify the Camel endpoint url
+ * we will route the Spring Integration message to the Camel context
+ * @author Willem Jiang
+ *
+ * @version $Revision$
+ */
+public class CamelTargetAdapter extends AbstractCamelAdapter {
+
+    private final Log logger = LogFactory.getLog(this.getClass());
+    private CamelTemplate<Exchange> camelTemplate;
+    private Endpoint camelEndpoint;
+
+    public CamelTemplate<Exchange> getCamelTemplate() {
+        if (camelTemplate == null) {
+            if (getCamelContext() != null) {
+                camelTemplate = new CamelTemplate<Exchange>(getCamelContext());
+            } else {
+                camelTemplate = new CamelTemplate<Exchange>(new DefaultCamelContext());
+            }
+        }
+        return camelTemplate;
+    }
+
+    public Message<?> handle(Message<?> request) {
+        ExchangePattern pattern;
+        if (isExpectReply()) {
+            pattern = ExchangePattern.InOut;
+        } else {
+            pattern = ExchangePattern.InOnly;
+        }
+        Exchange inExchange = new SpringIntegrationExchange(getCamelContext(), pattern);
+        SpringIntegrationBinding.storeToCamelMessage(request, inExchange.getIn());
+        Exchange outExchange = getCamelTemplate().send(getCamelEndpointUri(), inExchange);
+        Message response = null;
+        if (isExpectReply()) {
+            response = SpringIntegrationBinding.storeToSpringIntegrationMessage(outExchange.getOut());
+        }
+        return response;
+    }
+
+}

Propchange: activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/CamelTargetAdapter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/CamelTargetAdapter.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/config/AbstractCamelContextBeanDefinitionParaser.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/config/AbstractCamelContextBeanDefinitionParaser.java?rev=655008&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/config/AbstractCamelContextBeanDefinitionParaser.java (added)
+++ activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/config/AbstractCamelContextBeanDefinitionParaser.java Fri May  9 20:08:12 2008
@@ -0,0 +1,113 @@
+/**
+ * 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.component.spring.integration.adapter.config;
+
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import org.apache.camel.util.ObjectHelper;
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.beans.factory.config.RuntimeBeanReference;
+import org.springframework.beans.factory.support.BeanDefinitionBuilder;
+import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
+import org.springframework.beans.factory.xml.ParserContext;
+import org.springframework.util.StringUtils;
+
+/**
+ * This BeanDefinition paraser help to inject the camel context into the beans
+ *
+ * @author Willem Jiang
+ *
+ * @version $Revision$
+ */
+public class AbstractCamelContextBeanDefinitionParaser extends AbstractSingleBeanDefinitionParser {
+    private static final String DEFAULT_CAMEL_CONTEXT_NAME = "camelContext";
+
+    private String getContextId(String contextId) {
+        if (ObjectHelper.isNullOrBlank(contextId)) {
+            //Set the contextId default value here
+            return DEFAULT_CAMEL_CONTEXT_NAME;
+        } else {
+            return contextId;
+        }
+    }
+
+    protected void mapToProperty(BeanDefinitionBuilder bean, String propertyName, String val) {
+        if (ID_ATTRIBUTE.equals(propertyName)) {
+            return;
+        }
+
+        if (StringUtils.hasText(val)) {
+            if (val.startsWith("#")) {
+                bean.addPropertyReference(propertyName, val.substring(1));
+            } else {
+                bean.addPropertyValue(propertyName, val);
+            }
+        }
+    }
+
+    protected void wireCamelContext(BeanDefinitionBuilder bean, String camelContextId) {
+        bean.addPropertyReference("camelContext", camelContextId);
+    }
+
+    protected void parseAttributes(Element element, ParserContext ctx, BeanDefinitionBuilder bean) {
+        NamedNodeMap atts = element.getAttributes();
+
+        for (int i = 0; i < atts.getLength(); i++) {
+            Attr node = (Attr) atts.item(i);
+            String val = node.getValue();
+            String name = node.getLocalName();
+
+            if (name.equals("requestChannel") || name.equals("replyChannel")) {
+                bean.addPropertyReference(name, val);
+            } else {
+                mapToProperty(bean, name, val);
+            }
+        }
+    }
+
+    protected void parseCamelContext(Element element, ParserContext ctx, BeanDefinitionBuilder bean) {
+        NodeList children = element.getChildNodes();
+        for (int i = 0; i < children.getLength(); i++) {
+            Node n = children.item(i);
+            if (n.getNodeType() == Node.ELEMENT_NODE) {
+                String name = n.getLocalName();
+                if ("camelContext".equals(name)) {
+                    // Parser the camel context
+                    BeanDefinition bd = ctx.getDelegate().parseCustomElement((Element)n);
+                    // Get the inner camel context id
+                    String contextId = (String)bd.getPropertyValues().getPropertyValue("id").getValue();
+                    wireCamelContext(bean, getContextId(contextId));
+                } else if ("camelContextRef".equals(name)) {
+                    String contextId = n.getTextContent();
+                    wireCamelContext(bean, getContextId(contextId));
+                }
+            }
+        }
+    }
+
+    protected void doParse(Element element, ParserContext ctx, BeanDefinitionBuilder bean) {
+        parseAttributes(element, ctx, bean);
+        parseCamelContext(element, ctx, bean);
+
+    }
+
+}

Propchange: activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/config/AbstractCamelContextBeanDefinitionParaser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/config/AbstractCamelContextBeanDefinitionParaser.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/config/CamelSourceAdpaterParser.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/config/CamelSourceAdpaterParser.java?rev=655008&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/config/CamelSourceAdpaterParser.java (added)
+++ activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/config/CamelSourceAdpaterParser.java Fri May  9 20:08:12 2008
@@ -0,0 +1,40 @@
+/**
+ * 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.component.spring.integration.adapter.config;
+
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+
+import org.apache.camel.component.spring.integration.adapter.CamelSourceAdapter;
+import org.springframework.beans.factory.support.BeanDefinitionBuilder;
+import org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser;
+import org.springframework.beans.factory.xml.ParserContext;
+
+/**
+ * Parser for the &lt;camelSource/&gt; element
+ * @author Willem Jiang
+ *
+ * @version $Revision$
+ */
+public class CamelSourceAdpaterParser extends AbstractCamelContextBeanDefinitionParaser {
+    @Override
+    protected Class<?> getBeanClass(Element element) {
+        return CamelSourceAdapter.class;
+    }
+
+}

Propchange: activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/config/CamelSourceAdpaterParser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/config/CamelSourceAdpaterParser.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/config/CamelTargetAdapterParser.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/config/CamelTargetAdapterParser.java?rev=655008&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/config/CamelTargetAdapterParser.java (added)
+++ activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/config/CamelTargetAdapterParser.java Fri May  9 20:08:12 2008
@@ -0,0 +1,88 @@
+/**
+ * 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.component.spring.integration.adapter.config;
+
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+
+import org.apache.camel.component.spring.integration.adapter.CamelTargetAdapter;
+import org.springframework.beans.factory.parsing.BeanComponentDefinition;
+import org.springframework.beans.factory.support.BeanDefinitionBuilder;
+import org.springframework.beans.factory.support.RootBeanDefinition;
+import org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser;
+import org.springframework.beans.factory.xml.ParserContext;
+import org.springframework.integration.ConfigurationException;
+import org.springframework.integration.endpoint.HandlerEndpoint;
+import org.springframework.integration.scheduling.Subscription;
+import org.springframework.util.StringUtils;
+
+/**
+ * Parser for the &lt;camelTarget/&gt; element
+ * @author Willem Jiang
+ *
+ * @version $Revision$
+ */
+
+public class CamelTargetAdapterParser extends AbstractCamelContextBeanDefinitionParaser {
+    protected Class<?> getBeanClass(Element element) {
+        return HandlerEndpoint.class;
+    }
+
+    protected boolean shouldGenerateId() {
+        return false;
+    }
+
+    protected boolean shouldGenerateIdAsFallback() {
+        return true;
+    }
+
+    protected void parseAttributes(Element element, ParserContext ctx, BeanDefinitionBuilder bean) {
+        NamedNodeMap atts = element.getAttributes();
+        for (int i = 0; i < atts.getLength(); i++) {
+            Attr node = (Attr) atts.item(i);
+            String val = node.getValue();
+            String name = node.getLocalName();
+            if (!name.equals("requestChannel") && !name.equals("replyChannel")) {
+                mapToProperty(bean, name, val);
+            }
+        }
+    }
+
+    protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
+        BeanDefinitionBuilder adapterDefBuilder = BeanDefinitionBuilder.rootBeanDefinition(CamelTargetAdapter.class);
+        String requestChannel = element.getAttribute("requestChannel");
+        String replyChannel = element.getAttribute("replyChannel");
+        // Check the requestChannel
+        if (!StringUtils.hasText(requestChannel)) {
+            throw new ConfigurationException("The 'requestChannel' attribute is required.");
+        }
+        // Set the adapter bean's property
+        parseAttributes(element, parserContext, adapterDefBuilder);
+        parseCamelContext(element, parserContext, adapterDefBuilder);
+
+        String adapterBeanName = parserContext.getReaderContext().generateBeanName(adapterDefBuilder.getBeanDefinition());
+        parserContext.registerBeanComponent(new BeanComponentDefinition(adapterDefBuilder.getBeanDefinition(), adapterBeanName));
+        builder.addConstructorArgReference(adapterBeanName);
+        Subscription subscription = new Subscription(requestChannel);
+        builder.addPropertyValue("subscription", subscription);
+        if (StringUtils.hasText(replyChannel)) {
+            builder.addPropertyValue("outputChannelName", replyChannel);
+        }
+    }
+
+}

Propchange: activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/config/CamelTargetAdapterParser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/config/CamelTargetAdapterParser.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/config/NamespaceHandler.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/config/NamespaceHandler.java?rev=655008&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/config/NamespaceHandler.java (added)
+++ activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/config/NamespaceHandler.java Fri May  9 20:08:12 2008
@@ -0,0 +1,33 @@
+/**
+ * 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.component.spring.integration.adapter.config;
+
+import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
+
+/**
+ * The name space handler Spring Integration Camel Adapter
+ *
+ * @author Willem Jiang
+ *
+ * @version $Revision$
+ */
+public class NamespaceHandler extends NamespaceHandlerSupport {
+    public void init() {
+        registerBeanDefinitionParser("camelSource", new CamelSourceAdpaterParser());
+        registerBeanDefinitionParser("camelTarget", new CamelTargetAdapterParser());
+    }
+}

Propchange: activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/config/NamespaceHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/adapter/config/NamespaceHandler.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: activemq/camel/trunk/components/camel-spring-integration/src/main/resources/META-INF/LICENSE.txt
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring-integration/src/main/resources/META-INF/LICENSE.txt?rev=655008&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-spring-integration/src/main/resources/META-INF/LICENSE.txt (added)
+++ activemq/camel/trunk/components/camel-spring-integration/src/main/resources/META-INF/LICENSE.txt Fri May  9 20:08:12 2008
@@ -0,0 +1,203 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.
+

Propchange: activemq/camel/trunk/components/camel-spring-integration/src/main/resources/META-INF/LICENSE.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/components/camel-spring-integration/src/main/resources/META-INF/LICENSE.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: activemq/camel/trunk/components/camel-spring-integration/src/main/resources/META-INF/NOTICE.txt
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring-integration/src/main/resources/META-INF/NOTICE.txt?rev=655008&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-spring-integration/src/main/resources/META-INF/NOTICE.txt (added)
+++ activemq/camel/trunk/components/camel-spring-integration/src/main/resources/META-INF/NOTICE.txt Fri May  9 20:08:12 2008
@@ -0,0 +1,11 @@
+   =========================================================================
+   ==  NOTICE file corresponding to the section 4 d of                    ==
+   ==  the Apache License, Version 2.0,                                   ==
+   ==  in this case for the Apache Camel distribution.                    ==
+   =========================================================================
+
+   This product includes software developed by
+   The Apache Software Foundation (http://www.apache.org/).
+
+   Please read the different LICENSE files present in the licenses directory of
+   this distribution.

Propchange: activemq/camel/trunk/components/camel-spring-integration/src/main/resources/META-INF/NOTICE.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/components/camel-spring-integration/src/main/resources/META-INF/NOTICE.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: activemq/camel/trunk/components/camel-spring-integration/src/main/resources/META-INF/spring.handlers
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring-integration/src/main/resources/META-INF/spring.handlers?rev=655008&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-spring-integration/src/main/resources/META-INF/spring.handlers (added)
+++ activemq/camel/trunk/components/camel-spring-integration/src/main/resources/META-INF/spring.handlers Fri May  9 20:08:12 2008
@@ -0,0 +1,21 @@
+#
+#
+#    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.
+#
+#
+http\://activemq.apache.org/camel/schema/spring/integration=org.apache.camel.component.spring.integration.adapter.config.NamespaceHandler

Added: activemq/camel/trunk/components/camel-spring-integration/src/main/resources/META-INF/spring.schemas
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring-integration/src/main/resources/META-INF/spring.schemas?rev=655008&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-spring-integration/src/main/resources/META-INF/spring.schemas (added)
+++ activemq/camel/trunk/components/camel-spring-integration/src/main/resources/META-INF/spring.schemas Fri May  9 20:08:12 2008
@@ -0,0 +1,18 @@
+#
+# 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.
+#
+
+http\://activemq.apache.org/camel/schema/spring/integration/camel-spring-integration.xsd=schema/camel-spring-integration.xsd
\ No newline at end of file

Added: activemq/camel/trunk/components/camel-spring-integration/src/main/resources/schema/camel-spring-integration.xsd
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring-integration/src/main/resources/schema/camel-spring-integration.xsd?rev=655008&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-spring-integration/src/main/resources/schema/camel-spring-integration.xsd (added)
+++ activemq/camel/trunk/components/camel-spring-integration/src/main/resources/schema/camel-spring-integration.xsd Fri May  9 20:08:12 2008
@@ -0,0 +1,67 @@
+<?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.
+-->
+<xsd:schema xmlns="http://activemq.apache.org/camel/schema/spring/integration"
+  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+  xmlns:beans="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xmlns:camel-spring="http://activemq.apache.org/camel/schema/spring"
+  targetNamespace="http://activemq.apache.org/camel/schema/spring/integration"
+  elementFormDefault="qualified"
+  attributeFormDefault="unqualified">
+
+  <xsd:import namespace="http://www.springframework.org/schema/beans" schemaLocation="http://www.springframework.org/schema/beans/spring-beans.xsd"/>
+  <xsd:import namespace="http://activemq.apache.org/camel/schema/spring" schemaLocation="http://activemq.apache.org/camel/schema/spring/camel-spring.xsd"/>
+
+  <xsd:complexType name="camelEndpointType">
+  	<xsd:sequence>
+  		<xsd:element ref="camel-spring:camelContext" minOccurs="0" />
+  		<xsd:element name="camelContextRef" type="xsd:string" minOccurs="0" />
+  	</xsd:sequence>
+  	<xsd:attribute name="id" type="xsd:ID" use="required" />
+  	<xsd:attribute name="camelEndpointUri" type="xsd:string" />
+  	<xsd:attribute name="requestChannel" type="xsd:string" use="required" />
+  	<xsd:attribute name="replyChannel" type="xsd:string" />
+  	<xsd:attribute name="expectReply" type="xsd:boolean" default="true"/>
+  </xsd:complexType>
+
+  <xsd:element name="camelSource">
+     <xsd:complexType>
+        <xsd:annotation>
+			<xsd:documentation>
+	          Defines a camel-source for handling the Camel context message in Spring Integration message bus.
+			</xsd:documentation>
+		</xsd:annotation>
+        <xsd:complexContent>
+          <xsd:extension base="camelEndpointType">
+	       <xsd:attribute name="requestTimeout" type="xsd:long"/>
+		   <xsd:attribute name="replyTimeout" type="xsd:long"/>
+		  </xsd:extension>
+		</xsd:complexContent>
+     </xsd:complexType>
+  </xsd:element>
+
+  <xsd:element name="camelTarget" type="camelEndpointType">
+        <xsd:annotation>
+			<xsd:documentation>
+	          Defines a camel-target to feed Spring Integration message to the Camel context.
+			</xsd:documentation>
+		</xsd:annotation>
+  </xsd:element>
+</xsd:schema>

Propchange: activemq/camel/trunk/components/camel-spring-integration/src/main/resources/schema/camel-spring-integration.xsd
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/components/camel-spring-integration/src/main/resources/schema/camel-spring-integration.xsd
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: activemq/camel/trunk/components/camel-spring-integration/src/main/resources/schema/camel-spring-integration.xsd
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: activemq/camel/trunk/components/camel-spring-integration/src/test/java/org/apache/camel/component/spring/integration/HelloWorldService.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring-integration/src/test/java/org/apache/camel/component/spring/integration/HelloWorldService.java?rev=655008&r1=655007&r2=655008&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring-integration/src/test/java/org/apache/camel/component/spring/integration/HelloWorldService.java (original)
+++ activemq/camel/trunk/components/camel-spring-integration/src/test/java/org/apache/camel/component/spring/integration/HelloWorldService.java Fri May  9 20:08:12 2008
@@ -22,8 +22,15 @@
  */
 public class HelloWorldService {
 
+    private int count;
+
     public String sayHello(String name) {
+        count++;
         return "Hello " + name;
     }
 
+    public int getCount() {
+        return count;
+    }
+
 }

Added: activemq/camel/trunk/components/camel-spring-integration/src/test/java/org/apache/camel/component/spring/integration/adapter/CamelSourceAdapterTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring-integration/src/test/java/org/apache/camel/component/spring/integration/adapter/CamelSourceAdapterTest.java?rev=655008&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-spring-integration/src/test/java/org/apache/camel/component/spring/integration/adapter/CamelSourceAdapterTest.java (added)
+++ activemq/camel/trunk/components/camel-spring-integration/src/test/java/org/apache/camel/component/spring/integration/adapter/CamelSourceAdapterTest.java Fri May  9 20:08:12 2008
@@ -0,0 +1,41 @@
+/**
+ * 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.component.spring.integration.adapter;
+
+import org.apache.camel.component.spring.integration.HelloWorldService;
+import org.apache.camel.spring.SpringTestSupport;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+public class CamelSourceAdapterTest extends SpringTestSupport {
+    public void testSendingOneWayMessage() throws Exception {
+        HelloWorldService service = (HelloWorldService) applicationContext.getBean("helloService");
+        template.sendBody("direct:EndpointA", "Willem");
+        assertEquals("The service should be called ", service.getCount(), 1);
+
+    }
+
+    public void testSendingTwoWayMessage() throws Exception {
+        String result = (String) template.sendBody("direct:EndpointA", "Willem");
+        assertEquals("Can't get the right response", result, "Hello Willem");
+    }
+
+    @Override
+    protected ClassPathXmlApplicationContext createApplicationContext() {
+        return new ClassPathXmlApplicationContext("/org/apache/camel/component/spring/integration/adapter/CamelSource.xml");
+    }
+
+}

Propchange: activemq/camel/trunk/components/camel-spring-integration/src/test/java/org/apache/camel/component/spring/integration/adapter/CamelSourceAdapterTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/components/camel-spring-integration/src/test/java/org/apache/camel/component/spring/integration/adapter/CamelSourceAdapterTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: activemq/camel/trunk/components/camel-spring-integration/src/test/java/org/apache/camel/component/spring/integration/adapter/CamelTargetAdapterTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring-integration/src/test/java/org/apache/camel/component/spring/integration/adapter/CamelTargetAdapterTest.java?rev=655008&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-spring-integration/src/test/java/org/apache/camel/component/spring/integration/adapter/CamelTargetAdapterTest.java (added)
+++ activemq/camel/trunk/components/camel-spring-integration/src/test/java/org/apache/camel/component/spring/integration/adapter/CamelTargetAdapterTest.java Fri May  9 20:08:12 2008
@@ -0,0 +1,55 @@
+/**
+ * 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.component.spring.integration.adapter;
+
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.spring.SpringTestSupport;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+import org.springframework.integration.channel.MessageChannel;
+import org.springframework.integration.message.Message;
+import org.springframework.integration.message.StringMessage;
+
+public class CamelTargetAdapterTest extends SpringTestSupport {
+    private static final String MESSAGE_BODY = "hello world";
+
+    public void testSendingOneWayMessage() throws Exception {
+        MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
+        resultEndpoint.expectedBodiesReceived(MESSAGE_BODY);
+        MessageChannel outputChannel = (MessageChannel) applicationContext.getBean("channelA");
+        outputChannel.send(new StringMessage(MESSAGE_BODY));
+        resultEndpoint.assertIsSatisfied();
+    }
+
+    public void testSendingTwoWayMessage() throws Exception {
+
+        MessageChannel requestChannel = (MessageChannel) applicationContext.getBean("channelB");
+        Message message = new StringMessage(MESSAGE_BODY);
+        requestChannel.send(message);
+
+        MessageChannel responseChannel = (MessageChannel) applicationContext.getBean("channelC");
+        Message responseMessage = responseChannel.receive();
+        String result = (String) responseMessage.getPayload();
+
+        assertEquals("Get the wrong result", MESSAGE_BODY + " is processed",  result);
+    }
+
+    @Override
+    protected ClassPathXmlApplicationContext createApplicationContext() {
+        return new ClassPathXmlApplicationContext("org/apache/camel/component/spring/integration/adapter/CamelTarget.xml");
+    }
+
+}

Propchange: activemq/camel/trunk/components/camel-spring-integration/src/test/java/org/apache/camel/component/spring/integration/adapter/CamelTargetAdapterTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/components/camel-spring-integration/src/test/java/org/apache/camel/component/spring/integration/adapter/CamelTargetAdapterTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: activemq/camel/trunk/components/camel-spring-integration/src/test/java/org/apache/camel/component/spring/integration/adapter/ConfigurationTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring-integration/src/test/java/org/apache/camel/component/spring/integration/adapter/ConfigurationTest.java?rev=655008&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-spring-integration/src/test/java/org/apache/camel/component/spring/integration/adapter/ConfigurationTest.java (added)
+++ activemq/camel/trunk/components/camel-spring-integration/src/test/java/org/apache/camel/component/spring/integration/adapter/ConfigurationTest.java Fri May  9 20:08:12 2008
@@ -0,0 +1,49 @@
+/**
+ * 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.component.spring.integration.adapter;
+
+import junit.framework.TestCase;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+import org.springframework.integration.endpoint.HandlerEndpoint;
+
+public class ConfigurationTest extends TestCase {
+
+    public void testCamelSourceEndpoint() throws Exception {
+        ClassPathXmlApplicationContext ctx =
+            new ClassPathXmlApplicationContext(new String[] {"/org/apache/camel/component/spring/integration/adapter/CamelSource.xml"});
+        CamelSourceAdapter camelSourceA = (CamelSourceAdapter) ctx.getBean("camelSourceA");
+        assertNotNull(camelSourceA);
+        assertEquals("Get the wrong request channel name", camelSourceA.getChannel().getName(), "channelA");
+        assertEquals("ExpectReply should be false ", camelSourceA.isExpectReply(), false);
+        CamelSourceAdapter camelSourceB = (CamelSourceAdapter) ctx.getBean("camelSourceB");
+        assertNotNull(camelSourceB);
+        assertEquals("Get the wrong request channel name", camelSourceB.getChannel().getName(), "channelB");
+        assertEquals("ExpectReply should be true ", camelSourceB.isExpectReply(), true);
+
+    }
+
+    public void testCamelTragetEndpoint() throws Exception {
+        ClassPathXmlApplicationContext ctx =
+            new ClassPathXmlApplicationContext(new String[] {"/org/apache/camel/component/spring/integration/adapter/CamelTarget.xml"});
+        HandlerEndpoint handlerEndpointA = (HandlerEndpoint)ctx.getBean("camelTargetA");
+        assertNotNull(handlerEndpointA);
+        assertEquals("Subscript the wrong channel name", handlerEndpointA.getSubscription().getChannelName(), "channelA");
+        HandlerEndpoint handlerEndpointB = (HandlerEndpoint)ctx.getBean("camelTargetA");
+        assertNotNull(handlerEndpointB);
+        assertEquals("Subscript the wrong channel name", handlerEndpointB.getSubscription().getChannelName(), "channelA");
+    }
+}

Propchange: activemq/camel/trunk/components/camel-spring-integration/src/test/java/org/apache/camel/component/spring/integration/adapter/ConfigurationTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/components/camel-spring-integration/src/test/java/org/apache/camel/component/spring/integration/adapter/ConfigurationTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: activemq/camel/trunk/components/camel-spring-integration/src/test/resources/org/apache/camel/component/spring/integration/adapter/CamelSource.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring-integration/src/test/resources/org/apache/camel/component/spring/integration/adapter/CamelSource.xml?rev=655008&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-spring-integration/src/test/resources/org/apache/camel/component/spring/integration/adapter/CamelSource.xml (added)
+++ activemq/camel/trunk/components/camel-spring-integration/src/test/resources/org/apache/camel/component/spring/integration/adapter/CamelSource.xml Fri May  9 20:08:12 2008
@@ -0,0 +1,68 @@
+<?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:beans xmlns="http://www.springframework.org/schema/integration"
+       xmlns:beans="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:camel-si="http://activemq.apache.org/camel/schema/spring/integration"
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans
+       http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+       http://www.springframework.org/schema/integration
+	   http://www.springframework.org/schema/integration/spring-integration-1.0.xsd
+       http://cxf.apache.org/transports/camel http://cxf.apache.org/transports/camel.xsd
+       http://activemq.apache.org/camel/schema/spring/integration
+       http://activemq.apache.org/camel/schema/spring/integration/camel-spring-integration.xsd
+       http://activemq.apache.org/camel/schema/spring
+       http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
+    ">
+
+   	<message-bus/>
+
+   	<channel id="channelA"/>
+   	<channel id="channelB"/>
+   	<channel id="channelC"/>
+
+	<handler-endpoint input-channel="channelB"
+	          output-channel="channelC"
+	          handler="helloService"
+	          method="sayHello"/>
+
+   <beans:bean id="helloService" class="org.apache.camel.component.spring.integration.HelloWorldService"/>
+
+   <!-- START SNIPPET: example -->
+   <camelContext id="camelSourceContext" xmlns="http://activemq.apache.org/camel/schema/spring">
+       <route>
+           <from uri="direct:EndpointA"/>
+           <to uri="direct:EndpointB" />
+       </route>
+       <route>
+       	   <from uri="direct:EndpointA"/>
+           <to uri="direct:EndpointC" />
+       </route>
+   </camelContext>
+
+   <camel-si:camelSource id="camelSourceA" camelEndpointUri="direct:EndpointB" requestChannel="channelA" expectReply="false">
+       <camel-si:camelContextRef>camelSourceContext</camel-si:camelContextRef>
+   </camel-si:camelSource>
+
+   <camel-si:camelSource id="camelSourceB" camelEndpointUri="direct:EndpointC" requestChannel="channelB" replyChannel="channelC" expectReply="true">
+       <camel-si:camelContextRef>camelSourceContext</camel-si:camelContextRef>
+   </camel-si:camelSource>
+   <!-- END SNIPPET: example -->
+
+</beans:beans>

Propchange: activemq/camel/trunk/components/camel-spring-integration/src/test/resources/org/apache/camel/component/spring/integration/adapter/CamelSource.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/components/camel-spring-integration/src/test/resources/org/apache/camel/component/spring/integration/adapter/CamelSource.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: activemq/camel/trunk/components/camel-spring-integration/src/test/resources/org/apache/camel/component/spring/integration/adapter/CamelSource.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: activemq/camel/trunk/components/camel-spring-integration/src/test/resources/org/apache/camel/component/spring/integration/adapter/CamelTarget.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring-integration/src/test/resources/org/apache/camel/component/spring/integration/adapter/CamelTarget.xml?rev=655008&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-spring-integration/src/test/resources/org/apache/camel/component/spring/integration/adapter/CamelTarget.xml (added)
+++ activemq/camel/trunk/components/camel-spring-integration/src/test/resources/org/apache/camel/component/spring/integration/adapter/CamelTarget.xml Fri May  9 20:08:12 2008
@@ -0,0 +1,64 @@
+<?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:beans xmlns="http://www.springframework.org/schema/integration"
+       xmlns:beans="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:camel-si="http://activemq.apache.org/camel/schema/spring/integration"
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans
+       http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+       http://www.springframework.org/schema/integration
+	   http://www.springframework.org/schema/integration/spring-integration-1.0.xsd
+       http://cxf.apache.org/transports/camel http://cxf.apache.org/transports/camel.xsd
+       http://activemq.apache.org/camel/schema/spring/integration
+       http://activemq.apache.org/camel/schema/spring/integration/camel-spring-integration.xsd
+       http://activemq.apache.org/camel/schema/spring
+       http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
+    ">
+
+   	<message-bus/>
+
+   	<channel id="channelA"/>
+   	<channel id="channelB"/>
+    <channel id="channelC"/>
+
+
+   <!-- START SNIPPET: example -->
+   <camelContext id="camelTargetContext" xmlns="http://activemq.apache.org/camel/schema/spring">
+       <route>
+           <from uri="direct:EndpointA" />
+           <to uri="mock:result" />
+       </route>
+       <route>
+           <from uri="direct:EndpointC"/>
+           <process ref="myProcessor"/>
+         </route>
+   </camelContext>
+
+   <camel-si:camelTarget id="camelTargetA" camelEndpointUri="direct:EndpointA" requestChannel="channelA" expectReply="false">
+       <camel-si:camelContextRef>camelTargetContext</camel-si:camelContextRef>
+   </camel-si:camelTarget>
+
+   <camel-si:camelTarget id="camelTargetB" camelEndpointUri="direct:EndpointC" requestChannel="channelB" replyChannel="channelC" expectReply="true">
+       <camel-si:camelContextRef>camelTargetContext</camel-si:camelContextRef>
+   </camel-si:camelTarget>
+
+   <beans:bean id="myProcessor" class="org.apache.camel.component.spring.integration.MyProcessor"/>
+   <!-- END SNIPPET: example -->
+
+</beans:beans>

Propchange: activemq/camel/trunk/components/camel-spring-integration/src/test/resources/org/apache/camel/component/spring/integration/adapter/CamelTarget.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/components/camel-spring-integration/src/test/resources/org/apache/camel/component/spring/integration/adapter/CamelTarget.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: activemq/camel/trunk/components/camel-spring-integration/src/test/resources/org/apache/camel/component/spring/integration/adapter/CamelTarget.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: activemq/camel/trunk/components/camel-spring-integration/src/test/resources/org/apache/camel/component/spring/integration/producer.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring-integration/src/test/resources/org/apache/camel/component/spring/integration/producer.xml?rev=655008&r1=655007&r2=655008&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring-integration/src/test/resources/org/apache/camel/component/spring/integration/producer.xml (original)
+++ activemq/camel/trunk/components/camel-spring-integration/src/test/resources/org/apache/camel/component/spring/integration/producer.xml Fri May  9 20:08:12 2008
@@ -27,10 +27,10 @@
 
 	<message-bus auto-create-channels="true"/>
 
-	<endpoint input-channel="inputChannel"
-	          default-output-channel="outputChannel"
-	          handler-ref="helloService"
-	          handler-method="sayHello"/>
+	<handler-endpoint input-channel="inputChannel"
+	          output-channel="outputChannel"
+	          handler="helloService"
+	          method="sayHello"/>
 
 	<beans:bean id="helloService" class="org.apache.camel.component.spring.integration.HelloWorldService"/>