You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by js...@apache.org on 2007/03/19 11:55:06 UTC

svn commit: r519901 [2/2] - in /activemq/camel: branches/ tags/ trunk/ trunk/camel/ trunk/camel/camel-core/ trunk/camel/camel-core/src/ trunk/camel/camel-core/src/main/ trunk/camel/camel-core/src/main/java/ trunk/camel/camel-core/src/main/java/org/ tru...

Added: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/seda/SedaEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/seda/SedaEndpoint.java?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/seda/SedaEndpoint.java (added)
+++ activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/seda/SedaEndpoint.java Mon Mar 19 03:54:57 2007
@@ -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.seda;
+
+import org.apache.camel.impl.DefaultEndpoint;
+import org.apache.camel.impl.DefaultExchange;
+import org.apache.camel.ExchangeConverter;
+
+import java.util.Queue;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+/**
+ * Represents a SEDA endpoint using an internal {@link Queue}
+ * object to process inbound exchanges.
+ *
+ * @version $Revision$
+ */
+public class SedaEndpoint<E> extends DefaultEndpoint<E> {
+    private Queue queue;
+
+    public SedaEndpoint(String uri, ExchangeConverter exchangeConverter) {
+        this(uri, exchangeConverter, new ConcurrentLinkedQueue());
+    }
+
+    public SedaEndpoint(String uri, ExchangeConverter exchangeConverter, Queue queue) {
+        super(uri, exchangeConverter);
+        this.queue = queue;
+    }
+
+    public void send(E exchange) {
+        queue.add(exchange);
+    }
+
+    public E createExchange() {
+        return (E) new DefaultExchange();
+    }
+
+    public Queue getQueue() {
+        return queue;
+    }
+}

Propchange: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/seda/SedaEndpoint.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/seda/SedaEndpoint.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/seda/SedaEndpoint.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/seda/package.html
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/seda/package.html?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/seda/package.html (added)
+++ activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/seda/package.html Mon Mar 19 03:54:57 2007
@@ -0,0 +1,25 @@
+<!--
+    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.
+-->
+<html>
+<head>
+</head>
+<body>
+
+Defines SEDA endpoints
+
+</body>
+</html>

Propchange: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/seda/package.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/seda/package.html
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/seda/package.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java (added)
+++ activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java Mon Mar 19 03:54:57 2007
@@ -0,0 +1,29 @@
+/*
+ * 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.util;
+
+/**
+ * @version $Revision$
+ */
+public class ObjectHelper {
+    public static boolean equals(Object a, Object b) {
+        if (a == b) {
+            return true;
+        }
+        return a != null && b != null && a.equals(b);
+    }
+}

Propchange: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: activemq/camel/trunk/camel/camel-core/src/test/java/org/apache/camel/RouteBuilderTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-core/src/test/java/org/apache/camel/RouteBuilderTest.java?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-core/src/test/java/org/apache/camel/RouteBuilderTest.java (added)
+++ activemq/camel/trunk/camel/camel-core/src/test/java/org/apache/camel/RouteBuilderTest.java Mon Mar 19 03:54:57 2007
@@ -0,0 +1,65 @@
+/*
+ * 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;
+
+import junit.framework.TestCase;
+import org.apache.camel.builder.DestinationBuilder;
+import org.apache.camel.builder.RouteBuilder;
+
+import java.util.List;
+
+/**
+ * @version $Revision$
+ */
+public class RouteBuilderTest extends TestCase {
+
+    public void testSimpleRoute() throws Exception {
+        RouteBuilder builder = new RouteBuilder() {
+            public void configure() {
+                from("seda://a").to("seda://b");
+            }
+        };
+
+        List<DestinationBuilder> destinationBuilders = builder.getRoutes();
+        assertEquals("Number or destinationBuilders created", 1, destinationBuilders.size());
+        DestinationBuilder destinationBuilder = destinationBuilders.get(0);
+        Processor processor = destinationBuilder.createProcessor();
+        assertTrue("Processor should be a SendProcessor but was: " + processor + " with type: " + processor.getClass().getName(), processor instanceof SendProcessor);
+        SendProcessor sendProcessor = (SendProcessor) processor;
+        assertEquals("Endpoint URI", "seda://b", sendProcessor.getDestination().getEndpointUri());
+    }
+
+
+    public void testSimpleRouteWithHeaderPredicate() throws Exception {
+        RouteBuilder builder = new RouteBuilder() {
+            public void configure() {
+                from("seda://a").filter(headerEquals("foo", "bar")).to("seda://b");
+            }
+        };
+    }
+
+    public void testSimpleRouteWithChoice() throws Exception {
+        RouteBuilder builder = new RouteBuilder() {
+            public void configure() {
+                from("seda://a").choice()
+                        .when(headerEquals("foo", "bar")).to("seda://b")
+                        .when(headerEquals("foo", "cheese")).to("seda://c")
+                        .otherwise().to("seda://d");
+            }
+        };
+    }
+}

Propchange: activemq/camel/trunk/camel/camel-core/src/test/java/org/apache/camel/RouteBuilderTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel/camel-core/src/test/java/org/apache/camel/RouteBuilderTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: activemq/camel/trunk/camel/camel-core/src/test/java/org/apache/camel/RouteBuilderTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: activemq/camel/trunk/camel/camel-jms/pom.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-jms/pom.xml?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-jms/pom.xml (added)
+++ activemq/camel/trunk/camel/camel-jms/pom.xml Mon Mar 19 03:54:57 2007
@@ -0,0 +1,81 @@
+<?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.
+-->
+
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0">
+
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.camel</groupId>
+    <artifactId>camel-parent</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>camel-jms</artifactId>
+  <name>Camel :: JMS</name>
+  <description>Camel JMS support</description>
+
+  <dependencies>
+
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-core</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+
+    <dependency>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
+      <optional>false</optional>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.geronimo.specs</groupId>
+      <artifactId>geronimo-jms_1.1_spec</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.activemq</groupId>
+      <artifactId>apache-activemq</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.geronimo.specs</groupId>
+      <artifactId>geronimo-jta_1.0.1B_spec</artifactId>
+      <optional>true</optional>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.specs</groupId>
+      <artifactId>geronimo-j2ee-management_1.0_spec</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.specs</groupId>
+      <artifactId>geronimo-j2ee-jacc_1.0_spec</artifactId>
+      <optional>true</optional>
+    </dependency>
+
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+</project>

Propchange: activemq/camel/trunk/camel/camel-jms/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel/camel-jms/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: activemq/camel/trunk/camel/camel-jms/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/DefaultJmsExchange.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/DefaultJmsExchange.java?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/DefaultJmsExchange.java (added)
+++ activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/DefaultJmsExchange.java Mon Mar 19 03:54:57 2007
@@ -0,0 +1,116 @@
+/*
+ * 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.jms;
+
+import org.apache.camel.InvalidHeaderTypeException;
+import org.apache.camel.impl.ExchangeSupport;
+
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.Session;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @version $Revision$
+ */
+public class DefaultJmsExchange extends ExchangeSupport<Message> implements JmsExchange {
+    private Map<String, Object> lazyHeaders;
+
+    public <T> T getHeader(String name) {
+        Message request = getRequest();
+        if (request != null) {
+            try {
+                Object value = request.getObjectProperty(name);
+                try {
+                    return (T) value;
+                }
+                catch (ClassCastException e) {
+                    throw new InvalidHeaderTypeException(e.getMessage(), value);
+                }
+            }
+            catch (JMSException e) {
+                throw new MessagePropertyAcessException(name, e);
+            }
+        }
+        return null;
+    }
+
+    public void setHeader(String name, Object value) {
+        Message request = getRequest();
+        if (request != null) {
+            try {
+                request.setObjectProperty(name, value);
+            }
+            catch (JMSException e) {
+                throw new MessagePropertyAcessException(name, e);
+            }
+        }
+        else {
+            if (lazyHeaders == null) {
+                lazyHeaders = new HashMap<String, Object>();
+            }
+            lazyHeaders.put(name, value);
+        }
+    }
+
+    public Map<String, Object> getHeaders() {
+        Message request = getRequest();
+        if (request != null) {
+            Map<String, Object> answer = new HashMap<String, Object>();
+            Enumeration names = null;
+            try {
+                names = request.getPropertyNames();
+            }
+            catch (JMSException e) {
+                throw new MessagePropertyNamesAcessException(e);
+            }
+            while (names.hasMoreElements()) {
+                String name = names.nextElement().toString();
+                try {
+                    Object value = request.getObjectProperty(name);
+                    answer.put(name, value);
+                }
+                catch (JMSException e) {
+                    throw new MessagePropertyAcessException(name, e);
+                }
+            }
+            return answer;
+        }
+        else {
+            return lazyHeaders;
+        }
+    }
+
+
+    public Message createMessage(Session session) throws JMSException {
+        Message request = getRequest();
+        if (request == null) {
+            request = session.createMessage();
+
+            if (lazyHeaders != null) {
+                // lets add any lazy headers
+                for (Map.Entry<String, Object> entry : lazyHeaders.entrySet()) {
+                    request.setObjectProperty(entry.getKey(), entry.getValue());
+                }
+            }
+        }
+        return request;
+    }
+
+}

Propchange: activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/DefaultJmsExchange.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/DefaultJmsExchange.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/DefaultJmsExchange.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/JmsEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/JmsEndpoint.java?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/JmsEndpoint.java (added)
+++ activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/JmsEndpoint.java Mon Mar 19 03:54:57 2007
@@ -0,0 +1,73 @@
+/*
+ * 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.jms;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.ExchangeConverter;
+import org.apache.camel.impl.DefaultEndpoint;
+import org.springframework.jms.core.JmsOperations;
+import org.springframework.jms.core.MessageCreator;
+
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.Session;
+
+/**
+ * @version $Revision$
+ */
+public class JmsEndpoint extends DefaultEndpoint<JmsExchange> {
+
+    private JmsOperations template;
+    private Destination destination;
+
+
+    public JmsEndpoint(String uri, ExchangeConverter exchangeConverter, Destination destination, JmsOperations template) {
+        super(uri, exchangeConverter);
+        this.destination = destination;
+        this.template = template;
+    }
+
+    public void send(final JmsExchange exchange) {
+        template.send(getDestination(), new MessageCreator() {
+            public Message createMessage(Session session) throws JMSException {
+                return exchange.createMessage(session);
+            }
+        });
+    }
+
+    public void send(Exchange exchange) {
+        // lets convert to the type of an exchange
+        JmsExchange jmsExchange = convertTo(JmsExchange.class, exchange);
+        send(jmsExchange);
+    }
+
+    /**
+     * Returns the JMS destination for this endpoint
+     */
+    public Destination getDestination() {
+        return destination;
+    }
+
+    public JmsOperations getTemplate() {
+        return template;
+    }
+
+    public JmsExchange createExchange() {
+        return new DefaultJmsExchange();
+    }
+}

Propchange: activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/JmsEndpoint.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/JmsEndpoint.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/JmsEndpoint.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/JmsExchange.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/JmsExchange.java?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/JmsExchange.java (added)
+++ activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/JmsExchange.java Mon Mar 19 03:54:57 2007
@@ -0,0 +1,35 @@
+/*
+ * 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.jms;
+
+import org.apache.camel.Exchange;
+
+import javax.jms.Session;
+import javax.jms.Message;
+import javax.jms.JMSException;
+
+/**
+ * @version $Revision$
+ */
+public interface JmsExchange extends Exchange<Message> {
+
+    /**
+     * Creates the JMS message for this exchange so that it can be sent to
+     * a JMS endpoint.
+     */
+    Message createMessage(Session session) throws JMSException;
+}

Propchange: activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/JmsExchange.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/JmsExchange.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/JmsExchange.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/MessagePropertyAcessException.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/MessagePropertyAcessException.java?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/MessagePropertyAcessException.java (added)
+++ activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/MessagePropertyAcessException.java Mon Mar 19 03:54:57 2007
@@ -0,0 +1,35 @@
+/*
+ * 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.jms;
+
+import javax.jms.JMSException;
+
+/**
+ * @version $Revision$
+ */
+public class MessagePropertyAcessException extends RuntimeJmsException {
+    private String propertyName;
+
+    public MessagePropertyAcessException(String propertyName, JMSException e) {
+        super("Error accessing header: " + propertyName, e);
+        this.propertyName = propertyName;
+    }
+
+    public String getPropertyName() {
+        return propertyName;
+    }
+}

Propchange: activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/MessagePropertyAcessException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/MessagePropertyAcessException.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/MessagePropertyAcessException.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/MessagePropertyNamesAcessException.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/MessagePropertyNamesAcessException.java?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/MessagePropertyNamesAcessException.java (added)
+++ activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/MessagePropertyNamesAcessException.java Mon Mar 19 03:54:57 2007
@@ -0,0 +1,29 @@
+/*
+ * 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.jms;
+
+import javax.jms.JMSException;
+
+/**
+ * @version $Revision$
+ */
+public class MessagePropertyNamesAcessException extends RuntimeJmsException {
+
+    public MessagePropertyNamesAcessException(JMSException e) {
+        super("Failed to acess the JMS message property names", e);
+    }
+}

Propchange: activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/MessagePropertyNamesAcessException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/MessagePropertyNamesAcessException.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/MessagePropertyNamesAcessException.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/RuntimeJmsException.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/RuntimeJmsException.java?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/RuntimeJmsException.java (added)
+++ activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/RuntimeJmsException.java Mon Mar 19 03:54:57 2007
@@ -0,0 +1,28 @@
+/*
+ * 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.jms;
+
+import javax.jms.JMSException;
+
+/**
+ * @version $Revision$
+ */
+public class RuntimeJmsException extends RuntimeException {
+    public RuntimeJmsException(String message, JMSException cause) {
+        super(message, cause);
+    }
+}

Propchange: activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/RuntimeJmsException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/RuntimeJmsException.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/RuntimeJmsException.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/package.html
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/package.html?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/package.html (added)
+++ activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/package.html Mon Mar 19 03:54:57 2007
@@ -0,0 +1,25 @@
+<!--
+    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.
+-->
+<html>
+<head>
+</head>
+<body>
+
+Defines JMS exchanges and endpoints
+
+</body>
+</html>

Propchange: activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/package.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/package.html
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/package.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: activemq/camel/trunk/camel/pom.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/pom.xml?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/pom.xml (added)
+++ activemq/camel/trunk/camel/pom.xml Mon Mar 19 03:54:57 2007
@@ -0,0 +1,314 @@
+<?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.
+-->
+
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0">
+
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.camel</groupId>
+  <artifactId>camel-parent</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+  <name>Camel</name>
+  <description>Camel Parent POM</description>
+
+  <prerequisites>
+    <maven>2.0.4</maven>
+  </prerequisites>
+
+  <url>http://apache.apache.org/camel/</url>
+
+  <organization>
+    <name>Apache Software Foundation</name>
+    <url>http://www.apache.org/</url>
+  </organization>
+
+  <licenses>
+    <license>
+      <name>The Apache Software License, Version 2.0</name>
+      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+      <distribution>repo</distribution>
+    </license>
+  </licenses>
+
+  <mailingLists>
+    <mailingList>
+      <name>Development List</name>
+      <subscribe>dev@activemq.apache.org</subscribe>
+      <unsubscribe>dev@activemq.apache.org</unsubscribe>
+      <post>dev@activemq.apache.org</post>
+    </mailingList>
+  </mailingLists>
+
+  <repositories>
+    <repository>
+      <id>apache.incubating.releases</id>
+      <name>Apache Incubating Release Distribution Repository</name>
+      <url>http://people.apache.org/repo/m2-incubating-repository</url>
+    </repository>
+    <repository>
+      <id>apache.snapshots</id>
+      <name>Apache Development Snapshot Repository</name>
+      <url>http://people.apache.org/repo/m2-snapshot-repository</url>
+      <releases>
+        <enabled>false</enabled>
+      </releases>
+    </repository>
+  </repositories>
+
+  <pluginRepositories>
+    <pluginRepository>
+      <id>apache.incubating.releases</id>
+      <name>Apache Incubating Release Distribution Repository</name>
+      <url>http://people.apache.org/repo/m2-incubating-repository</url>
+    </pluginRepository>
+    <pluginRepository>
+      <id>apache.snapshots</id>
+      <name>Apache Development Snapshot Repository</name>
+      <url>http://people.apache.org/repo/m2-snapshot-repository</url>
+      <releases>
+        <enabled>false</enabled>
+      </releases>
+    </pluginRepository>
+  </pluginRepositories>
+
+  <distributionManagement>
+    <repository>
+      <id>apache.incubating.releases</id>
+      <name>Apache Incubating Release Distribution Repository</name>
+      <url>${dist-repo-url}</url>
+    </repository>
+    <snapshotRepository>
+      <id>apache.snapshots</id>
+      <name>Apache Development Snapshot Repository</name>
+      <url>scp://people.apache.org/www/people.apache.org/repo/m2-snapshot-repository</url>
+    </snapshotRepository>
+    <site>
+      <id>apache.website</id>
+      <url>${site-repo-url}</url>
+    </site>
+  </distributionManagement>
+
+  <modules>
+    <module>camel-core</module>
+    <module>camel-jms</module>
+  </modules>
+
+  <scm>
+    <connection>scm:svn:https://svn.apache.org/repos/asf/activemq/camel/trunk</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/activemq/camel/trunk</developerConnection>
+    <url>http://svn.apache.org/viewvc/activemq/camel/trunk/</url>
+  </scm>
+
+  <dependencyManagement>
+    <dependencies>
+      <!-- =============================== -->
+      <!-- ActiveMQ Dependencies -->
+      <!-- =============================== -->
+      <dependency>
+        <groupId>org.apache.activemq</groupId>
+        <artifactId>apache-activemq</artifactId>
+        <version>4.1.0-incubator</version>
+      </dependency>
+
+      <!-- =============================== -->
+      <!-- Required dependencies -->
+      <!-- =============================== -->
+      <dependency>
+        <groupId>commons-logging</groupId>
+        <artifactId>commons-logging</artifactId>
+        <version>1.1</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-jms_1.1_spec</artifactId>
+        <version>1.0</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-jta_1.0.1B_spec</artifactId>
+        <version>1.0</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-j2ee-management_1.0_spec</artifactId>
+        <version>1.0</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-j2ee-jacc_1.0_spec</artifactId>
+        <version>1.0</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-j2ee-connector_1.5_spec</artifactId>
+        <version>1.0</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-jsp_2.0_spec</artifactId>
+        <version>1.0</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-servlet_2.4_spec</artifactId>
+        <version>1.0</version>
+      </dependency>
+
+      <dependency>
+        <groupId>log4j</groupId>
+        <artifactId>log4j</artifactId>
+        <version>1.2.12</version>
+        <scope>runtime</scope>
+        <optional>true</optional>
+      </dependency>
+      <!-- Optional Spring Support -->
+      <dependency>
+        <groupId>org.springframework</groupId>
+        <artifactId>spring</artifactId>
+        <version>2.0</version>
+        <optional>true</optional>
+        <exclusions>
+          <exclusion>
+            <groupId>javax.mail</groupId>
+            <artifactId>mail</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>javax.resource</groupId>
+            <artifactId>connector</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>javax.transaction</groupId>
+            <artifactId>jta</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-support</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-orm</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-hibernate</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-remoting</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-core</artifactId>
+          </exclusion>
+        </exclusions>
+      </dependency>
+
+      <dependency>
+        <groupId>junit</groupId>
+        <artifactId>junit</artifactId>
+        <version>3.8.1</version>
+        <scope>test</scope>
+      </dependency>
+
+    </dependencies>
+  </dependencyManagement>
+
+
+  <build>
+    <pluginManagement>
+      <plugins>
+	      <plugin>
+	        <groupId>org.apache.maven.plugins</groupId>
+	        <artifactId>maven-compiler-plugin</artifactId>
+	        <configuration>
+	          <source>1.5</source>
+	          <target>1.5</target>
+	        </configuration>
+	      </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+  <reporting>
+    <plugins>
+      <plugin>
+        <artifactId>maven-javadoc-plugin</artifactId>
+      </plugin>
+<!--
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jxr-plugin</artifactId>
+      </plugin>
+-->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-report-plugin</artifactId>
+      </plugin>
+<!--
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-pmd-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>cobertura-maven-plugin</artifactId>
+      </plugin>
+-->
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>taglist-maven-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-javadoc-plugin</artifactId>
+        <configuration>
+          <links>
+            <link>http://java.sun.com/j2se/1.5.0/docs/api/</link>
+            <link>http://java.sun.com/j2ee/1.4/docs/api/</link>
+            <link>http://jakarta.apache.org/commons/collections/apidocs-COLLECTIONS_3_0/</link>
+            <link>http://jakarta.apache.org/commons/dbcp/apidocs/</link>
+            <link>http://jakarta.apache.org/commons/fileupload/apidocs/</link>
+            <link>http://jakarta.apache.org/commons/httpclient/apidocs/</link>
+            <link>http://jakarta.apache.org/commons/logging/apidocs/</link>
+            <link>http://jakarta.apache.org/commons/pool/apidocs/</link>
+            <link>http://junit.sourceforge.net/javadoc/</link>
+            <link>http://logging.apache.org/log4j/docs/api/</link>
+          </links>
+          <!-- <stylesheetfile>${basedir}/../etc/css/stylesheet.css</stylesheetfile> -->
+          <linksource>true</linksource>
+          <maxmemory>900m</maxmemory>
+          <source>1.5</source>
+        </configuration>
+      </plugin>
+    </plugins>
+  </reporting>
+
+</project>

Propchange: activemq/camel/trunk/camel/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel/pom.xml
------------------------------------------------------------------------------
    svn:executable = *

Propchange: activemq/camel/trunk/camel/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: activemq/camel/trunk/camel/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml