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 [1/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...

Author: jstrachan
Date: Mon Mar 19 03:54:57 2007
New Revision: 519901

URL: http://svn.apache.org/viewvc?view=rev&rev=519901
Log:
Initial checkin of Camel routing library

Added:
    activemq/camel/branches/
    activemq/camel/tags/
    activemq/camel/trunk/
    activemq/camel/trunk/camel/
    activemq/camel/trunk/camel/camel-core/
    activemq/camel/trunk/camel/camel-core/pom.xml   (with props)
    activemq/camel/trunk/camel/camel-core/src/
    activemq/camel/trunk/camel/camel-core/src/main/
    activemq/camel/trunk/camel/camel-core/src/main/java/
    activemq/camel/trunk/camel/camel-core/src/main/java/org/
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/Endpoint.java   (with props)
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/EndpointResolver.java   (with props)
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/Exchange.java   (with props)
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/ExchangeConverter.java   (with props)
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/FilterProcessor.java   (with props)
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/InvalidHeaderTypeException.java   (with props)
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/Predicate.java   (with props)
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/Predicates.java   (with props)
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/Processor.java   (with props)
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/RuntimeCamelException.java   (with props)
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/SendProcessor.java   (with props)
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/ChoiceBuilder.java   (with props)
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/ChoicePredicateBuilder.java   (with props)
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/ConfiguredDestinationBuilder.java   (with props)
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/DestinationBuilder.java   (with props)
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/OldProcessorBuilder.java   (with props)
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/PredicateBuilder.java   (with props)
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/ProcessorBuilder.java   (with props)
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/RouteBuilder.java   (with props)
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/UndefinedDestinationException.java   (with props)
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/package.html   (with props)
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/impl/
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java   (with props)
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpointResolver.java   (with props)
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java   (with props)
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/impl/DefaultExchangeConverter.java   (with props)
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/impl/ExchangeSupport.java   (with props)
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/impl/package.html   (with props)
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/package.html   (with props)
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/seda/
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/seda/SedaEndpoint.java   (with props)
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/seda/package.html   (with props)
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/util/
    activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java   (with props)
    activemq/camel/trunk/camel/camel-core/src/test/
    activemq/camel/trunk/camel/camel-core/src/test/java/
    activemq/camel/trunk/camel/camel-core/src/test/java/org/
    activemq/camel/trunk/camel/camel-core/src/test/java/org/apache/
    activemq/camel/trunk/camel/camel-core/src/test/java/org/apache/camel/
    activemq/camel/trunk/camel/camel-core/src/test/java/org/apache/camel/RouteBuilderTest.java   (with props)
    activemq/camel/trunk/camel/camel-jms/
    activemq/camel/trunk/camel/camel-jms/pom.xml   (with props)
    activemq/camel/trunk/camel/camel-jms/src/
    activemq/camel/trunk/camel/camel-jms/src/main/
    activemq/camel/trunk/camel/camel-jms/src/main/java/
    activemq/camel/trunk/camel/camel-jms/src/main/java/org/
    activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/
    activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/
    activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/
    activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/DefaultJmsExchange.java   (with props)
    activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/JmsEndpoint.java   (with props)
    activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/JmsExchange.java   (with props)
    activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/MessagePropertyAcessException.java   (with props)
    activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/MessagePropertyNamesAcessException.java   (with props)
    activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/RuntimeJmsException.java   (with props)
    activemq/camel/trunk/camel/camel-jms/src/main/java/org/apache/camel/jms/package.html   (with props)
    activemq/camel/trunk/camel/pom.xml   (with props)

Added: activemq/camel/trunk/camel/camel-core/pom.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-core/pom.xml?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-core/pom.xml (added)
+++ activemq/camel/trunk/camel/camel-core/pom.xml Mon Mar 19 03:54:57 2007
@@ -0,0 +1,50 @@
+<?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-core</artifactId>
+  <name>Camel :: Core</name>
+  <description>The Core Camel POJO based router</description>
+
+  <dependencies>
+
+    <dependency>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
+      <optional>false</optional>
+    </dependency>
+
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+</project>

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

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

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

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

Added: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/Endpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/Endpoint.java?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/Endpoint.java (added)
+++ activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/Endpoint.java Mon Mar 19 03:54:57 2007
@@ -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;
+
+/**
+ * Represents an endpoint on which messages can be exchanged
+ *
+ * @version $Revision$
+ */
+public interface Endpoint<E>  {
+
+    /**
+     * Returns the string representation of the URI
+     */
+    public String getEndpointUri();
+
+    /**
+     * Sends the mesage exchange to this endpoint
+     */
+    void send(E exchange);
+
+    /**
+     * Create a new exchange for communicating with this endpoint
+     */
+    E createExchange();
+}

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

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

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

Added: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/EndpointResolver.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/EndpointResolver.java?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/EndpointResolver.java (added)
+++ activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/EndpointResolver.java Mon Mar 19 03:54:57 2007
@@ -0,0 +1,30 @@
+/*
+ * 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;
+
+/**
+ * A resolver of endpoints from a String URI
+ *
+ * @version $Revision$
+ */
+public interface EndpointResolver<E> {
+
+    /**
+     * Resolves the given uri or returns null if no endpoint could be found
+     */
+    public Endpoint<E> resolve(String uri);
+}

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

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

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

Added: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/Exchange.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/Exchange.java?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/Exchange.java (added)
+++ activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/Exchange.java Mon Mar 19 03:54:57 2007
@@ -0,0 +1,68 @@
+/*
+ * 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 java.util.Map;
+
+/**
+ * Represents the base interface of an exchange
+ *
+ * @version $Revision$
+ */
+public interface Exchange<M> {
+
+    /**
+     * Accesses a specific header
+     */
+    <T> T getHeader(String name);
+
+    /**
+     * Sets a header on the exchange
+     */
+    void setHeader(String name, Object value);
+
+    /**
+     * Returns all of the headers associated with the request
+     */
+    Map<String,Object> getHeaders();
+
+    /**
+     * Returns the request message
+     */
+    M getRequest();
+
+    /**
+     * Returns the response message
+     */
+    M getResponse();
+
+    /**
+     * Returns the fault message
+     */
+    M getFault();
+
+    /**
+     * Returns the exception associated with this exchange
+     */
+    Exception getException();
+
+    /**
+     * Sets the exception associated with this exchange
+     */
+    void setException(Exception e);
+
+}

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

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

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

Added: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/ExchangeConverter.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/ExchangeConverter.java?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/ExchangeConverter.java (added)
+++ activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/ExchangeConverter.java Mon Mar 19 03:54:57 2007
@@ -0,0 +1,27 @@
+/*
+ * 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;
+
+/**
+ * This converter is capable of converting from an exchange to another type
+ *
+ * @version $Revision$
+ */
+public interface ExchangeConverter {
+
+     <T> T  convertTo(Class<T> type, Exchange exchange);
+}

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

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

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

Added: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/FilterProcessor.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/FilterProcessor.java?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/FilterProcessor.java (added)
+++ activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/FilterProcessor.java Mon Mar 19 03:54:57 2007
@@ -0,0 +1,42 @@
+/**
+ *
+ * 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;
+
+/**
+ * @version $Revision$
+ */
+public class FilterProcessor<E> implements Processor<E> {
+    private Predicate<E> predicate;
+    private Processor<E> processor;
+
+    public FilterProcessor(Predicate<E> predicate, Processor<E> processor) {
+        this.predicate = predicate;
+        this.processor = processor;
+    }
+
+    public void onExchange(E exchange) {
+        if (predicate.evaluate(exchange)) {
+            processor.onExchange(exchange);
+        }
+    }
+
+    @Override
+    public String toString() {
+        return "if (" + predicate + ") " + processor;
+    }
+}

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

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

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

Added: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/InvalidHeaderTypeException.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/InvalidHeaderTypeException.java?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/InvalidHeaderTypeException.java (added)
+++ activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/InvalidHeaderTypeException.java Mon Mar 19 03:54:57 2007
@@ -0,0 +1,47 @@
+/*
+ * 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;
+
+/**
+ * @version $Revision$
+ */
+public class InvalidHeaderTypeException extends RuntimeCamelException {
+    private Object headerValue;
+
+    public InvalidHeaderTypeException(Throwable cause, Object headerValue) {
+        super(cause.getMessage() + " headerValue is: " + headerValue + " of type: "
+                + typeName(headerValue), cause);
+        this.headerValue = headerValue;
+    }
+
+    public InvalidHeaderTypeException(String message, Object headerValue) {
+        super(message);
+        this.headerValue = headerValue;
+    }
+
+
+    /**
+     * Returns the actual header value
+     */
+    public Object getHeaderValue() {
+        return headerValue;
+    }
+
+    protected static String typeName(Object headerValue) {
+        return (headerValue != null) ? headerValue.getClass().getName() : "null";
+    }
+}

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

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

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

Added: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/Predicate.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/Predicate.java?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/Predicate.java (added)
+++ activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/Predicate.java Mon Mar 19 03:54:57 2007
@@ -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;
+
+/**
+ * Evaluates a binary predicate on the message exchange
+ *
+ * @version $Revision$
+ */
+public interface Predicate<E> {
+
+    /**
+     * Evaluates the predicate on the message exchange
+     *
+     * @param exchange the message exchange
+     * @return true if the predicate matches
+     */
+    boolean evaluate(E exchange);
+}

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

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

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

Added: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/Predicates.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/Predicates.java?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/Predicates.java (added)
+++ activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/Predicates.java Mon Mar 19 03:54:57 2007
@@ -0,0 +1,59 @@
+/*
+ * 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;
+
+/**
+ * A helper class for working with predicates
+ *
+ * @version $Revision$
+ */
+public class Predicates {
+
+    public static void notNull(Object value, String name) {
+        if (value == null) {
+            throw new NullPointerException("No " + name + " specified");
+        }
+    }
+
+    /**
+     * A helper method to combine multiple predicates by a logical AND
+     */
+    public static <E> Predicate<E> and(final Predicate<E> left, final Predicate<E> right) {
+        notNull(left, "left");
+        notNull(right, "right");
+        return new Predicate<E>() {
+            public boolean evaluate(E exchange) {
+                return left.evaluate(exchange) && right.evaluate(exchange);
+            }
+        };
+    }
+
+    /**
+     * A helper method to combine multiple predicates by a logical OR
+     */
+    public static <E> Predicate<E> or(final Predicate<E> left, final Predicate<E> right) {
+        notNull(left, "left");
+        notNull(right, "right");
+        return new Predicate<E>() {
+            public boolean evaluate(E exchange) {
+                return left.evaluate(exchange) || right.evaluate(exchange);
+            }
+        };
+    }
+
+
+}

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

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

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

Added: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/Processor.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/Processor.java?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/Processor.java (added)
+++ activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/Processor.java Mon Mar 19 03:54:57 2007
@@ -0,0 +1,30 @@
+/*
+ * 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;
+
+/**
+ * A processor of a message exchange.
+ * 
+ * @version $Revision$
+ */
+public interface Processor<E> {
+
+    /**
+     * Processes the message exchange
+     */
+    void onExchange(E exchange);
+}

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

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

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

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

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

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

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

Added: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/SendProcessor.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/SendProcessor.java?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/SendProcessor.java (added)
+++ activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/SendProcessor.java Mon Mar 19 03:54:57 2007
@@ -0,0 +1,42 @@
+/**
+ *
+ * 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;
+
+/**
+ * @version $Revision$
+ */
+public class SendProcessor<E> implements Processor<E> {
+    private Endpoint<E> destination;
+
+    public SendProcessor(Endpoint<E> destination) {
+        this.destination = destination;
+    }
+
+    public void onExchange(E exchange) {
+        destination.send(exchange);
+    }
+
+    public Endpoint<E> getDestination() {
+        return destination;
+    }
+
+    @Override
+    public String toString() {
+        return "sendTo (" + destination + ")";
+    }
+}

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

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

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

Added: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/ChoiceBuilder.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/ChoiceBuilder.java?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/ChoiceBuilder.java (added)
+++ activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/ChoiceBuilder.java Mon Mar 19 03:54:57 2007
@@ -0,0 +1,60 @@
+/*
+ * 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.builder;
+
+import org.apache.camel.Predicate;
+import org.apache.camel.Exchange;
+
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * @version $Revision$
+ */
+public class ChoiceBuilder<E extends Exchange> extends DestinationBuilder<E> {
+
+    private final DestinationBuilder<E> parent;
+    private List<ChoicePredicateBuilder<E>> predicateBuilders = new ArrayList<ChoicePredicateBuilder<E>>();
+    private DestinationBuilder otherwise;
+
+    public ChoiceBuilder(DestinationBuilder<E> parent) {
+        super(parent);
+        this.parent = parent;
+    }
+
+    /**
+     * Adds a predicate which if it is true then the message exchange is sent to the given destination
+     */
+    public ChoicePredicateBuilder<E> when(Predicate<E> predicate) {
+        ChoicePredicateBuilder<E> answer = new ChoicePredicateBuilder<E>(this, predicate);
+        predicateBuilders.add(answer);
+        return answer;
+    }
+
+    public DestinationBuilder<E> otherwise() {
+        this.otherwise = new DestinationBuilder(parent);
+        return parent;
+    }
+
+    public List<ChoicePredicateBuilder<E>> getPredicateBuilders() {
+        return predicateBuilders;
+    }
+
+    public DestinationBuilder getOtherwise() {
+        return otherwise;
+    }
+}

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

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

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

Added: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/ChoicePredicateBuilder.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/ChoicePredicateBuilder.java?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/ChoicePredicateBuilder.java (added)
+++ activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/ChoicePredicateBuilder.java Mon Mar 19 03:54:57 2007
@@ -0,0 +1,46 @@
+/**
+ *
+ * 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.builder;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Predicate;
+import org.apache.camel.Endpoint;
+
+/**
+ * @version $Revision$
+ */
+public class ChoicePredicateBuilder<E extends Exchange> extends PredicateBuilder<E> {
+    private final ChoiceBuilder<E> parent;
+
+    public ChoicePredicateBuilder(ChoiceBuilder<E> parent, Predicate<E> predicate) {
+        super(parent, predicate);
+        this.parent = parent;
+    }
+
+    @Override
+    public ChoiceBuilder<E> to(Endpoint<E> endpoint) {
+        super.to(endpoint);
+        return parent;
+    }
+
+    @Override
+    public ChoiceBuilder<E> to(String uri) {
+        super.to(uri);
+        return parent;
+    }
+}

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

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

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

Added: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/ConfiguredDestinationBuilder.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/ConfiguredDestinationBuilder.java?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/ConfiguredDestinationBuilder.java (added)
+++ activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/ConfiguredDestinationBuilder.java Mon Mar 19 03:54:57 2007
@@ -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.builder;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Processor;
+import org.apache.camel.Exchange;
+import org.apache.camel.SendProcessor;
+
+/**
+ * @version $Revision$
+ */
+public class ConfiguredDestinationBuilder<E extends Exchange> extends DestinationBuilder<E> {
+    private Endpoint<E> destination;
+
+    public ConfiguredDestinationBuilder(DestinationBuilder<E> parent, Endpoint<E> endpoint) {
+        super(parent);
+        this.destination = endpoint;
+    }
+
+    @Override
+    public Processor<E> createProcessor() {
+        return new SendProcessor<E>(destination);
+    }
+}

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

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

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

Added: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/DestinationBuilder.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/DestinationBuilder.java?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/DestinationBuilder.java (added)
+++ activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/DestinationBuilder.java Mon Mar 19 03:54:57 2007
@@ -0,0 +1,99 @@
+/*
+ * 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.builder;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.Exchange;
+import org.apache.camel.Predicate;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.ProcessorBuilder;
+
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * @version $Revision$
+ */
+public class DestinationBuilder<E extends Exchange> implements ProcessorBuilder<E> {
+    private RouteBuilder<E> builder;
+    private Endpoint<E> from;
+    private List<ProcessorBuilder<E>> processBuilders = new ArrayList<ProcessorBuilder<E>>();
+
+    public DestinationBuilder(DestinationBuilder<E> parent) {
+        this(parent.getBuilder(), parent.getFrom());
+    }
+
+    public DestinationBuilder(RouteBuilder builder, Endpoint<E> from) {
+        this.builder = builder;
+        this.from = from;
+    }
+
+    /**
+     * Resolves the given URI to an endpoint
+     */
+    public Endpoint<E> endpoint(String uri) {
+        return getBuilder().endpoint(uri);
+    }
+
+    /**
+     * Sends the exchange to the given endpoint URI
+     */
+    public ProcessorBuilder<E> to(String uri) {
+        return to(endpoint(uri));
+    }
+
+    /**
+     * Sends the exchange to the given endpoint
+     */
+    public ProcessorBuilder<E> to(Endpoint<E> endpoint) {
+        ConfiguredDestinationBuilder<E> answer = new ConfiguredDestinationBuilder<E>(this, endpoint);
+        builder.addRoute(answer);
+        return answer;
+    }
+
+    /**
+     * Creates a predicate which is applied and only if it is true then
+     * the exchange is forwarded to the destination
+     */
+    public PredicateBuilder<E> filter(Predicate predicate) {
+        return new PredicateBuilder<E>(this, predicate);
+    }
+
+    /**
+     * Creates a choice of one or more predicates with an otherwise clause
+     */
+    public ChoiceBuilder<E> choice() {
+        return new ChoiceBuilder<E>(this);
+    }
+
+    public RouteBuilder<E> getBuilder() {
+        return builder;
+    }
+
+    public Endpoint<E> getFrom() {
+        return from;
+    }
+
+    public void addProcessBuilder(ProcessorBuilder<E> processBuilder) {
+        processBuilders.add(processBuilder);
+    }
+
+    public Processor<E> createProcessor() {
+        throw new UndefinedDestinationException();
+    }
+}

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

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

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

Added: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/OldProcessorBuilder.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/OldProcessorBuilder.java?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/OldProcessorBuilder.java (added)
+++ activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/OldProcessorBuilder.java Mon Mar 19 03:54:57 2007
@@ -0,0 +1,70 @@
+/**
+ *
+ * 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.builder;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Endpoint;
+import org.apache.camel.Predicate;
+import org.apache.camel.Processor;
+
+/**
+ * @version $Revision$
+ */
+public class OldProcessorBuilder<E extends Exchange> {
+    private DestinationBuilder<E> route;
+    private Endpoint<E> destination;
+    private Predicate<E> predicate;
+
+    public OldProcessorBuilder(DestinationBuilder<E> route, Endpoint<E> destination) {
+        this.route = route;
+        this.destination = destination;
+        // TODO
+        //route.addProcessBuilder(this);
+    }
+
+    public Processor<E> createProcessor() {
+        if (predicate != null) {
+            return new Processor<E>() {
+                public void onExchange(E exchange) {
+                    if (predicate.evaluate(exchange)) {
+                        destination.send(exchange);
+                    }
+                }
+            };
+        }
+        else {
+            return new Processor<E>() {
+                public void onExchange(E exchange) {
+                    destination.send(exchange);
+                }
+            };
+        }
+    }
+
+    public Endpoint<E> getDestination() {
+        return destination;
+    }
+
+    public Predicate<E> getPredicate() {
+        return predicate;
+    }
+
+    public DestinationBuilder<E> getRoute() {
+        return route;
+    }
+}

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

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

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

Added: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/PredicateBuilder.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/PredicateBuilder.java?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/PredicateBuilder.java (added)
+++ activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/PredicateBuilder.java Mon Mar 19 03:54:57 2007
@@ -0,0 +1,53 @@
+/*
+ * 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.builder;
+
+import org.apache.camel.Predicate;
+import org.apache.camel.Exchange;
+import org.apache.camel.Predicates;
+
+/**
+ * @version $Revision$
+ */
+public class PredicateBuilder<E extends Exchange> extends DestinationBuilder<E> {
+    private Predicate<E> predicate;
+
+    public PredicateBuilder(DestinationBuilder<E> builder, Predicate<E> predicate) {
+        super(builder);
+        this.predicate = predicate;
+    }
+
+    /**
+     * Adds another predicate using a logican AND
+     */
+    public PredicateBuilder<E> and(Predicate<E> predicate) {
+        this.predicate = Predicates.and(this.predicate, predicate);
+        return this;
+    }
+
+    /**
+     * Adds another predicate using a logican OR
+     */
+    public PredicateBuilder<E> or(Predicate<E> predicate) {
+        this.predicate = Predicates.or(this.predicate, predicate);
+        return this;
+    }
+
+    public Predicate<E> getPredicate() {
+        return predicate;
+    }
+}

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

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

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

Added: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/ProcessorBuilder.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/ProcessorBuilder.java?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/ProcessorBuilder.java (added)
+++ activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/ProcessorBuilder.java Mon Mar 19 03:54:57 2007
@@ -0,0 +1,32 @@
+/*
+ * 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.builder;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.Predicate;
+import org.apache.camel.Processor;
+import org.apache.camel.Predicates;
+import org.apache.camel.builder.DestinationBuilder;
+
+/**
+ * @version $Revision$
+ */
+public interface ProcessorBuilder<E extends Exchange> {
+
+    public Processor<E> createProcessor();
+}

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

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

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

Added: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/RouteBuilder.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/RouteBuilder.java?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/RouteBuilder.java (added)
+++ activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/RouteBuilder.java Mon Mar 19 03:54:57 2007
@@ -0,0 +1,111 @@
+/*
+ * 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.builder;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.EndpointResolver;
+import org.apache.camel.Exchange;
+import org.apache.camel.Predicate;
+import org.apache.camel.util.ObjectHelper;
+import org.apache.camel.impl.DefaultEndpointResolver;
+import org.apache.camel.builder.DestinationBuilder;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+/**
+ * A builder of destinationBuilders using a typesafe Java DLS.
+ *
+ * @version $Revision$
+ */
+public abstract class RouteBuilder<E extends Exchange> {
+
+    private EndpointResolver<E> endpointResolver;
+    private List<DestinationBuilder<E>> destinationBuilders = new ArrayList<DestinationBuilder<E>>();
+    private AtomicBoolean initalized = new AtomicBoolean(false);
+
+    /**
+     * Called on initialisation to to build the required destinationBuilders
+     */
+    public abstract void configure();
+
+    /**
+     * Resolves the given URI to an endpoint
+     */
+    public Endpoint<E> endpoint(String uri) {
+        return getEndpointResolver().resolve(uri);
+    }
+
+    public DestinationBuilder<E> from(String uri) {
+        return from(endpoint(uri));
+    }
+
+    public DestinationBuilder<E> from(Endpoint<E> endpoint) {
+        return new DestinationBuilder<E>(this, endpoint);
+    }
+
+    public void addRoute(DestinationBuilder<E> destinationBuilder) {
+        destinationBuilders.add(destinationBuilder);
+    }
+
+
+    // Helper methods
+    //-----------------------------------------------------------------------
+    public Predicate<E> headerEquals(final String header, final Object value) {
+        return new Predicate<E>() {
+            public boolean evaluate(E exchange) {
+                return ObjectHelper.equals(value, exchange.getHeader(header));
+            }
+        };
+    }
+
+    // Properties
+    //-----------------------------------------------------------------------
+
+    /**
+     * Returns the destinationBuilders which have been created
+     */
+    public List<DestinationBuilder<E>> getRoutes() {
+        checkInitialized();
+        return destinationBuilders;
+    }
+
+    public EndpointResolver<E> getEndpointResolver() {
+        if (endpointResolver == null) {
+            endpointResolver = createEndpointResolver();
+        }
+        return endpointResolver;
+    }
+
+    public void setEndpointResolver(EndpointResolver<E> endpointResolver) {
+        this.endpointResolver = endpointResolver;
+    }
+
+    // Implementation methods
+    //-----------------------------------------------------------------------
+    protected EndpointResolver<E> createEndpointResolver() {
+        return new DefaultEndpointResolver<E>();
+    }
+
+    protected void checkInitialized() {
+        if (initalized.compareAndSet(false, true)) {
+            configure();
+        }
+    }
+
+}

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

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

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

Added: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/UndefinedDestinationException.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/UndefinedDestinationException.java?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/UndefinedDestinationException.java (added)
+++ activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/UndefinedDestinationException.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.builder;
+
+import org.apache.camel.RuntimeCamelException;
+
+/**
+ * @version $Revision$
+ */
+public class UndefinedDestinationException extends RuntimeCamelException {
+    public UndefinedDestinationException() {
+        super("No destination defined for this routing rule");
+    }
+}

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

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

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

Added: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/package.html
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/package.html?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/package.html (added)
+++ activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/builder/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>
+
+The Camel routing DSL
+
+</body>
+</html>

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

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

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

Added: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java (added)
+++ activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java Mon Mar 19 03:54:57 2007
@@ -0,0 +1,54 @@
+/*
+ * 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.impl;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.ExchangeConverter;
+
+/**
+ * @version $Revision$
+ */
+public abstract class DefaultEndpoint<E> implements Endpoint<E> {
+    private String endpointUri;
+    private ExchangeConverter exchangeConverter;
+
+    protected DefaultEndpoint(String endpointUri, ExchangeConverter exchangeConverter) {
+        this.endpointUri = endpointUri;
+        this.exchangeConverter = exchangeConverter;
+    }
+
+    public String getEndpointUri() {
+        return endpointUri;
+    }
+
+    public ExchangeConverter getExchangeConverter() {
+        return exchangeConverter;
+    }
+
+    /**
+     * Converts the given exchange to the specified exchange type
+     */
+    public E convertTo(Class<E> type, Exchange exchange) {
+        // TODO we could infer type parameter
+        if (type.isInstance(exchange)) {
+            return type.cast(exchange);
+        }
+        return getExchangeConverter().convertTo(type, exchange);
+    }
+
+}

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

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

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

Added: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpointResolver.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpointResolver.java?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpointResolver.java (added)
+++ activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpointResolver.java Mon Mar 19 03:54:57 2007
@@ -0,0 +1,61 @@
+/*
+ * 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.impl;
+
+import org.apache.camel.EndpointResolver;
+import org.apache.camel.Endpoint;
+import org.apache.camel.ExchangeConverter;
+import org.apache.camel.seda.SedaEndpoint;
+
+/**
+ * A default implementation of {@link org.apache.camel.EndpointResolver}
+ *
+ * @version $Revision$
+ */
+public class DefaultEndpointResolver<E> implements EndpointResolver<E> {
+    private ExchangeConverter exchangeConverter;
+
+    public DefaultEndpointResolver() {
+    }
+
+    public DefaultEndpointResolver(ExchangeConverter exchangeConverter) {
+        this.exchangeConverter = exchangeConverter;
+    }
+    public Endpoint<E> resolve(String uri) {
+        // TODO we may want to cache them?
+        return new SedaEndpoint<E>(uri, getExchangeConverter());
+    }
+
+    public ExchangeConverter getExchangeConverter() {
+        if (exchangeConverter == null) {
+            exchangeConverter =           createExchangeConverter();
+        }
+        return exchangeConverter;
+    }
+
+    public void setExchangeConverter(ExchangeConverter exchangeConverter) {
+        this.exchangeConverter = exchangeConverter;
+    }
+
+    /**
+     * Lazily create a default exchange converter implementation
+     */
+    protected ExchangeConverter createExchangeConverter() {
+        return new DefaultExchangeConverter();
+    }
+
+}

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

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

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

Added: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java (added)
+++ activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java Mon Mar 19 03:54:57 2007
@@ -0,0 +1,54 @@
+/*
+ * 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.impl;
+
+import org.apache.camel.Exchange;
+
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * A default implementation of {@link Exchange}
+ *
+ * @version $Revision$
+ */
+public class DefaultExchange<M> extends ExchangeSupport<M> {
+    private Map<String,Object> headers;
+
+    public Object getHeader(String name) {
+        if (headers != null) {
+            return headers.get(name);
+        }
+        return null;
+    }
+
+    public void setHeader(String name, Object value) {
+        if (headers == null) {
+            headers = new HashMap<String, Object>();
+        }
+        headers.put(name, value);
+    }
+
+    public Map<String, Object> getHeaders() {
+        return headers;
+    }
+
+    public void setHeaders(Map<String, Object> headers) {
+        this.headers = headers;
+    }
+
+}

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

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

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

Added: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/impl/DefaultExchangeConverter.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/impl/DefaultExchangeConverter.java?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/impl/DefaultExchangeConverter.java (added)
+++ activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/impl/DefaultExchangeConverter.java Mon Mar 19 03:54:57 2007
@@ -0,0 +1,31 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.impl;
+
+import org.apache.camel.ExchangeConverter;
+import org.apache.camel.Exchange;
+
+/**
+ * @version $Revision$
+ */
+public class DefaultExchangeConverter implements ExchangeConverter {
+    public <T> T convertTo(Class<T> type, Exchange exchange) {
+        // TODO use some kinda introspection to find available exchange conversions
+        return null;
+    }
+}

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

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

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

Added: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/impl/ExchangeSupport.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/impl/ExchangeSupport.java?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/impl/ExchangeSupport.java (added)
+++ activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/impl/ExchangeSupport.java Mon Mar 19 03:54:57 2007
@@ -0,0 +1,63 @@
+/*
+ * 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.impl;
+
+import org.apache.camel.Exchange;
+
+/**
+ * A base class useful for implementing other typesafe exchanges
+ *
+ * @version $Revision$
+ */
+public abstract class ExchangeSupport<M> implements Exchange<M> {
+    private M request;
+    private M response;
+    private M fault;
+    private Exception exception;
+
+    public Exception getException() {
+        return exception;
+    }
+
+    public void setException(Exception exception) {
+        this.exception = exception;
+    }
+
+    public M getFault() {
+        return fault;
+    }
+
+    public void setFault(M fault) {
+        this.fault = fault;
+    }
+
+    public M getRequest() {
+        return request;
+    }
+
+    public void setRequest(M request) {
+        this.request = request;
+    }
+
+    public M getResponse() {
+        return response;
+    }
+
+    public void setResponse(M response) {
+        this.response = response;
+    }
+}

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

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

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

Added: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/impl/package.html
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/impl/package.html?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/impl/package.html (added)
+++ activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/impl/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>
+
+The default implementation classes
+
+</body>
+</html>

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

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

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

Added: activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/package.html
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/package.html?view=auto&rev=519901
==============================================================================
--- activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/package.html (added)
+++ activemq/camel/trunk/camel/camel-core/src/main/java/org/apache/camel/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>
+
+The core Camel API and DSL
+
+</body>
+</html>

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

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

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