You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by js...@apache.org on 2007/07/10 14:21:16 UTC

svn commit: r554921 - in /activemq/camel/trunk: ./ camel-core/ components/camel-jaxb/ components/camel-spring/ components/camel-spring/src/main/java/org/apache/camel/spring/model/ components/camel-spring/src/main/resources/org/apache/camel/spring/model...

Author: jstrachan
Date: Tue Jul 10 05:21:14 2007
New Revision: 554921

URL: http://svn.apache.org/viewvc?view=rev&rev=554921
Log:
initial spike attempting to use JAXB2 to parse the XML for route for CAMEL-71

Added:
    activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/
    activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/CamelContextType.java   (with props)
    activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/FromType.java   (with props)
    activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/OutputType.java   (with props)
    activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/ProcessorRef.java   (with props)
    activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/ProcessorType.java   (with props)
    activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/RouteType.java   (with props)
    activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/ToType.java   (with props)
    activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/package-info.java   (with props)
    activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/package.html   (contents, props changed)
      - copied, changed from r554558, activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/package.html
    activemq/camel/trunk/components/camel-spring/src/main/resources/org/apache/camel/spring/model/
    activemq/camel/trunk/components/camel-spring/src/main/resources/org/apache/camel/spring/model/jaxb.index
    activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/model/
    activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/model/XmlParseTest.java   (with props)
    activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/model/
    activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/model/example1.xml   (with props)
Modified:
    activemq/camel/trunk/camel-core/pom.xml
    activemq/camel/trunk/components/camel-jaxb/pom.xml
    activemq/camel/trunk/components/camel-spring/pom.xml
    activemq/camel/trunk/pom.xml

Modified: activemq/camel/trunk/camel-core/pom.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/pom.xml?view=diff&rev=554921&r1=554920&r2=554921
==============================================================================
--- activemq/camel/trunk/camel-core/pom.xml (original)
+++ activemq/camel/trunk/camel-core/pom.xml Tue Jul 10 05:21:14 2007
@@ -59,15 +59,12 @@
       <artifactId>log4j</artifactId>
       <scope>test</scope>
     </dependency>
+
   </dependencies>
 
 
   <build>
     <plugins>
-      <plugin>
-        <groupId>com.sun.tools.jxc.maven2</groupId>
-        <artifactId>maven-jaxb-schemagen-plugin</artifactId>
-      </plugin>
 
       <!-- generate the attached tests jar -->
       <plugin>

Modified: activemq/camel/trunk/components/camel-jaxb/pom.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jaxb/pom.xml?view=diff&rev=554921&r1=554920&r2=554921
==============================================================================
--- activemq/camel/trunk/components/camel-jaxb/pom.xml (original)
+++ activemq/camel/trunk/components/camel-jaxb/pom.xml Tue Jul 10 05:21:14 2007
@@ -51,27 +51,11 @@
     <dependency>
       <groupId>stax</groupId>
       <artifactId>stax-api</artifactId>
-      <version>1.0.1</version>
     </dependency>
 
     <dependency>
       <groupId>com.sun.xml.bind</groupId>
       <artifactId>jaxb-impl</artifactId>
-      <version>2.0.1</version>
-      <exclusions>
-        <exclusion>
-          <groupId>javax.xml</groupId>
-          <artifactId>jsr173</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>javax.jws</groupId>
-          <artifactId>jsr181-api</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>javax.activation</groupId>
-          <artifactId>activation</artifactId>
-        </exclusion>
-      </exclusions>
       <scope>test</scope>
     </dependency>
 

Modified: activemq/camel/trunk/components/camel-spring/pom.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/pom.xml?view=diff&rev=554921&r1=554920&r2=554921
==============================================================================
--- activemq/camel/trunk/components/camel-spring/pom.xml (original)
+++ activemq/camel/trunk/components/camel-spring/pom.xml Tue Jul 10 05:21:14 2007
@@ -38,12 +38,24 @@
       <groupId>org.apache.camel</groupId>
       <artifactId>camel-core</artifactId>
     </dependency>
-
     <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring</artifactId>
     </dependency>
+    <dependency>
+      <groupId>javax.xml</groupId>
+      <artifactId>jaxb-api</artifactId>
+      <optional>true</optional>
+    </dependency>
+
+    <!-- for parsing the XML -->
+    <dependency>
+      <groupId>com.sun.xml.bind</groupId>
+      <artifactId>jaxb-impl</artifactId>
+      <optional>true</optional>
+    </dependency>
 
+    <!-- for testing -->
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
@@ -69,6 +81,17 @@
 
   </dependencies>
 
+  <repositories>
+    <!-- for maven jaxb plugin -->
+    <repository>
+      <id>java.net</id>
+      <name>java.net Maven Repository</name>
+      <url>http://download.java.net/maven/1</url>
+      <!--<url>https://maven-repository.dev.java.net/nonav/repository</url>-->
+      <layout>legacy</layout>
+    </repository>
+  </repositories>
+
   <build>
     <plugins>
       <plugin>
@@ -142,6 +165,52 @@
         </executions>
       </plugin>
 
+
+      <plugin>
+        <groupId>com.sun.tools.jxc.maven2</groupId>
+        <artifactId>maven-jaxb-schemagen-plugin</artifactId>
+        <version>1.2</version>
+        <executions>
+          <execution>
+            <phase>process-sources</phase>
+            <configuration>
+              <destdir>${project.build.directory}/schema</destdir>
+              <includes>
+                <include>org/apache/camel/spring/model/**</include>
+              </includes>
+              <schemas>
+                <schema>
+                  <namespace>http://activemq.apache.org/camel/schema/spring</namespace>
+                  <file>came-spring.xsd</file>
+                </schema>
+              </schemas>
+              <srcdir>${project.build.sourceDirectory}</srcdir>
+              <!--<verbose>true</verbose>-->
+            </configuration>
+            <goals>
+              <goal>generate</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+
+<!--
+      <plugin>
+        <groupId>com.sun.tools.xjc.maven2</groupId>
+        <artifactId>maven-jaxb-plugin</artifactId>
+        <version>1.1</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>generate</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <generatePackage>org.apache.camel.spring.model</generatePackage>
+        </configuration>
+      </plugin>
+-->
 
       <plugin>
         <groupId>org.codehaus.mojo</groupId>

Added: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/CamelContextType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/CamelContextType.java?view=auto&rev=554921
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/CamelContextType.java (added)
+++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/CamelContextType.java Tue Jul 10 05:21:14 2007
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.spring.model;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAccessType;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Represents an XML &lt;camelContext/&gt; element
+ *
+ * @version $Revision: $
+ */
+@XmlRootElement(name = "camelContext")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class CamelContextType {
+    @XmlElements({
+    @XmlElement(name = "route", type = RouteType.class)})
+    private List<RouteType> routes = new ArrayList<RouteType>();
+
+    @Override
+    public String toString() {
+        return "Context[routes: " + routes + "]";
+    }
+
+    // Properties
+    //-----------------------------------------------------------------------
+
+    /**
+     * A list of routes
+     *
+     * @return
+     */
+    public List<RouteType> getRoutes() {
+        return routes;
+    }
+
+    /**
+     * Sets the routes to use
+     *
+     * @param routes
+     */
+    public void setRoutes(List<RouteType> routes) {
+        this.routes = routes;
+    }
+}
\ No newline at end of file

Propchange: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/CamelContextType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/FromType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/FromType.java?view=auto&rev=554921
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/FromType.java (added)
+++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/FromType.java Tue Jul 10 05:21:14 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.spring.model;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.CamelContextAware;
+import org.apache.camel.Endpoint;
+import org.apache.camel.Processor;
+import org.apache.camel.Route;
+import org.apache.camel.builder.ProcessorFactory;
+import org.apache.camel.impl.EventDrivenConsumerRoute;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAccessType;
+
+/**
+ * Represents an XML &lt;to/&gt; element
+ *
+ * @version $Revision: $
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlRootElement(name = "from")
+public class FromType {
+    @XmlAttribute
+    private String uri;
+
+    @Override
+    public String toString() {
+        return "From[" + uri + "]";
+    }
+
+    // Properties
+    //-----------------------------------------------------------------------
+    public String getUri() {
+        return uri;
+    }
+
+    public void setUri(String uri) {
+        this.uri = uri;
+    }
+
+}
\ No newline at end of file

Propchange: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/FromType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/OutputType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/OutputType.java?view=auto&rev=554921
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/OutputType.java (added)
+++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/OutputType.java Tue Jul 10 05:21:14 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.spring.model;
+
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAccessType;
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * A useful base class for output types
+ * 
+ * @version $Revision: 1.1 $
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+public abstract class OutputType {
+    @XmlElements({
+    @XmlElement(name = "process", type = ProcessorRef.class),
+    @XmlElement(name = "to", type = ToType.class)})
+    protected List<ProcessorType> processor = new ArrayList<ProcessorType>();
+
+    public List<ProcessorType> getProcessor() {
+        return processor;
+    }
+
+    public void setProcessor(List<ProcessorType> processor) {
+        this.processor = processor;
+    }
+}

Propchange: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/OutputType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/ProcessorRef.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/ProcessorRef.java?view=auto&rev=554921
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/ProcessorRef.java (added)
+++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/ProcessorRef.java Tue Jul 10 05:21:14 2007
@@ -0,0 +1,41 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.spring.model;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * @version $Revision: 1.1 $
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlRootElement(name = "process")
+public class ProcessorRef implements ProcessorType {
+    @XmlAttribute(required = true)
+    private String ref;
+
+    public String getRef() {
+        return ref;
+    }
+
+    public void setRef(String ref) {
+        this.ref = ref;
+    }
+}

Propchange: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/ProcessorRef.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/ProcessorType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/ProcessorType.java?view=auto&rev=554921
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/ProcessorType.java (added)
+++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/ProcessorType.java Tue Jul 10 05:21:14 2007
@@ -0,0 +1,24 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.spring.model;
+
+/**
+ * @version $Revision: 1.1 $
+ */
+public interface ProcessorType {
+}

Propchange: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/ProcessorType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/RouteType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/RouteType.java?view=auto&rev=554921
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/RouteType.java (added)
+++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/RouteType.java Tue Jul 10 05:21:14 2007
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.spring.model;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.CamelContextAware;
+import org.apache.camel.Endpoint;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.ProcessorFactory;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Represents an XML &lt;route/&gt; element
+ *
+ * @version $Revision: $
+ */
+@XmlRootElement(name = "root")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class RouteType extends OutputType implements CamelContextAware, ProcessorFactory {
+    @XmlTransient
+    private CamelContext camelContext;
+    @XmlElement(required = true)
+    private List<FromType> from = new ArrayList<FromType>();
+
+/*
+    public Route createRoute() throws Exception {
+        return new EventDrivenConsumerRoute(getEndpoint(), createProcessor());
+    }
+*/
+
+    @Override
+    public String toString() {
+        return "Route[from: " + from + " processor: " + processor + "]";
+    }
+
+
+    // Properties
+    //-----------------------------------------------------------------------
+
+    public List<FromType> getFrom() {
+        return from;
+    }
+
+    public void setFrom(List<FromType> from) {
+        this.from = from;
+    }
+
+    public CamelContext getCamelContext() {
+        return camelContext;
+    }
+
+    public void setCamelContext(CamelContext camelContext) {
+        this.camelContext = camelContext;
+    }
+
+    public Processor createProcessor() throws Exception {
+        return null;  // TODO
+    }
+
+    protected Endpoint resolveEndpoint(String uri) {
+        CamelContext context = getCamelContext();
+        if (context == null) {
+            throw new IllegalArgumentException("No CamelContext has been injected!");
+        }
+        Endpoint answer = context.getEndpoint(uri);
+        if (answer == null) {
+            throw new IllegalArgumentException("No Endpoint found for uri: " + uri);
+        }
+        return answer;
+    }
+}

Propchange: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/RouteType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/ToType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/ToType.java?view=auto&rev=554921
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/ToType.java (added)
+++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/ToType.java Tue Jul 10 05:21:14 2007
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.spring.model;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlAttribute;
+
+/**
+ * Represents an XML &lt;to/&gt; element
+ *
+ * @version $Revision: $
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlRootElement(name = "to")
+public class ToType implements ProcessorType {
+    @XmlAttribute
+    private String uri;
+
+    @Override
+    public String toString() {
+        return "To[" + uri + "]";
+    }
+
+    // Properties
+    //-----------------------------------------------------------------------
+    public String getUri() {
+        return uri;
+    }
+
+    public void setUri(String uri) {
+        this.uri = uri;
+    }
+}
\ No newline at end of file

Propchange: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/ToType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/package-info.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/package-info.java?view=auto&rev=554921
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/package-info.java (added)
+++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/package-info.java Tue Jul 10 05:21:14 2007
@@ -0,0 +1,2 @@
+@javax.xml.bind.annotation.XmlSchema(namespace = "http://activemq.apache.org/camel/schema/spring", elementFormDefault=javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package org.apache.camel.spring.model;

Propchange: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/package.html (from r554558, activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/package.html)
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/package.html?view=diff&rev=554921&p1=activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/package.html&r1=554558&p2=activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/package.html&r2=554921
==============================================================================
    (empty)

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

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

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

Added: activemq/camel/trunk/components/camel-spring/src/main/resources/org/apache/camel/spring/model/jaxb.index
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/resources/org/apache/camel/spring/model/jaxb.index?view=auto&rev=554921
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/resources/org/apache/camel/spring/model/jaxb.index (added)
+++ activemq/camel/trunk/components/camel-spring/src/main/resources/org/apache/camel/spring/model/jaxb.index Tue Jul 10 05:21:14 2007
@@ -0,0 +1,5 @@
+CamelContextType
+FromType
+ProcessorRef
+RouteType
+ToType
\ No newline at end of file

Added: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/model/XmlParseTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/model/XmlParseTest.java?view=auto&rev=554921
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/model/XmlParseTest.java (added)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/model/XmlParseTest.java Tue Jul 10 05:21:14 2007
@@ -0,0 +1,56 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.spring.model;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.JAXBException;
+
+import org.apache.camel.TestSupport;
+import org.apache.camel.spring.model.CamelContextType;
+
+import java.net.URL;
+
+/**
+ * @version $Revision: 1.1 $
+ */
+public class XmlParseTest extends TestSupport {
+    protected JAXBContext context;
+
+    public void testParseXml() throws Exception {
+        Object value = parseUri("example1.xml");
+        CamelContextType context = assertIsInstanceOf(CamelContextType.class, value);
+
+        log.info("Found: " + context);
+    }
+
+    protected Object parseUri(String uri) throws JAXBException {
+        Unmarshaller unmarshaller = context.createUnmarshaller();
+        URL resource = getClass().getResource(uri);
+        assertNotNull("Cannot find resource on the classpath: " + uri, resource);
+        Object value = unmarshaller.unmarshal(resource);
+        return value;
+    }
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+
+        context = JAXBContext.newInstance("org.apache.camel.spring.model");
+    }
+}

Propchange: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/model/XmlParseTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/model/example1.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/model/example1.xml?view=auto&rev=554921
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/model/example1.xml (added)
+++ activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/model/example1.xml Tue Jul 10 05:21:14 2007
@@ -0,0 +1,29 @@
+<?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.
+-->
+<camelContext xmlns="http://activemq.apache.org/camel/schema/spring"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+  <!--
+       xsi:schemaLocation="http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd"
+  -->
+
+  <route>
+    <from uri="seda:a"/>
+    <to uri="seda:b"/>
+  </route>
+</camelContext>

Propchange: activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/model/example1.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: activemq/camel/trunk/pom.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/pom.xml?view=diff&rev=554921&r1=554920&r2=554921
==============================================================================
--- activemq/camel/trunk/pom.xml (original)
+++ activemq/camel/trunk/pom.xml Tue Jul 10 05:21:14 2007
@@ -307,6 +307,41 @@
         </exclusions>
       </dependency>
       <dependency>
+        <groupId>stax</groupId>
+        <artifactId>stax-api</artifactId>
+        <version>1.0.1</version>
+      </dependency>
+
+      <dependency>
+        <groupId>com.sun.xml.bind</groupId>
+        <artifactId>jaxb-impl</artifactId>
+        <version>2.0.3</version>
+        <exclusions>
+<!--
+          <exclusion>
+            <groupId>javax.xml</groupId>
+            <artifactId>jsr173</artifactId>
+          </exclusion>
+-->
+          <exclusion>
+            <groupId>javax.jws</groupId>
+            <artifactId>jsr181-api</artifactId>
+          </exclusion>
+<!--
+          <exclusion>
+            <groupId>javax.activation</groupId>
+            <artifactId>activation</artifactId>
+          </exclusion>
+-->
+        </exclusions>
+      </dependency>
+      <dependency>
+        <groupId>com.sun.xml.bind</groupId>
+        <artifactId>jaxb-xjc</artifactId>
+        <version>2.0.3</version>
+      </dependency>
+
+      <dependency>
         <groupId>commons-logging</groupId>
         <artifactId>commons-logging</artifactId>
         <version>1.0.4</version>
@@ -556,6 +591,7 @@
         <version>10.1.3.1</version>
         <scope>test</scope>
       </dependency>
+
     </dependencies>
   </dependencyManagement>
 
@@ -617,7 +653,7 @@
         <plugin>
           <groupId>com.sun.tools.jxc.maven2</groupId>
           <artifactId>maven-jaxb-schemagen-plugin</artifactId>
-          <version>1.1</version>
+          <version>1.2</version>
         </plugin>
       </plugins>
     </pluginManagement>