svn commit: r662722 - in /activemq/camel/trunk/camel-core/src/main/java/org/apache/camel: CamelContext.java Routes.java builder/RouteBuilder.java impl/DefaultCamelContext.java

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r662722 - in /activemq/camel/trunk/camel-core/src/main/java/org/apache/camel: CamelContext.java Routes.java builder/RouteBuilder.java impl/DefaultCamelContext.java

hadrian-3
Author: hadrian
Date: Tue Jun  3 02:38:43 2008
New Revision: 662722

URL: http://svn.apache.org/viewvc?rev=662722&view=rev
Log:
CAMEL-547.

Added:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Routes.java
Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/RouteBuilder.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java?rev=662722&r1=662721&r2=662722&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java Tue Jun  3 02:38:43 2008
@@ -20,7 +20,6 @@
 import java.util.List;
 import java.util.concurrent.Callable;
 
-import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.model.RouteType;
 import org.apache.camel.spi.ExchangeConverter;
 import org.apache.camel.spi.Injector;
@@ -155,7 +154,7 @@
      * @param builder the builder which will create the routes and add them to this context
      * @throws Exception if the routes could not be created for whatever reason
      */
-    void addRoutes(RouteBuilder builder) throws Exception;
+    void addRoutes(Routes builder) throws Exception;
 
     /**
      * Adds a collection of route definitions to the context

Added: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Routes.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Routes.java?rev=662722&view=auto
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Routes.java (added)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Routes.java Tue Jun  3 02:38:43 2008
@@ -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;
+
+import java.util.List;
+
+public interface Routes {
+
+    CamelContext getContext();
+    
+    void setContext(CamelContext context);
+
+    List<Route> getRouteList() throws Exception;
+}

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/RouteBuilder.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/RouteBuilder.java?rev=662722&r1=662721&r2=662722&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/RouteBuilder.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/RouteBuilder.java Tue Jun  3 02:38:43 2008
@@ -24,6 +24,7 @@
 import org.apache.camel.Endpoint;
 import org.apache.camel.Predicate;
 import org.apache.camel.Route;
+import org.apache.camel.Routes;
 import org.apache.camel.impl.DefaultCamelContext;
 import org.apache.camel.model.ChoiceType;
 import org.apache.camel.model.ExceptionType;
@@ -40,7 +41,7 @@
  *
  * @version $Revision$
  */
-public abstract class RouteBuilder extends BuilderSupport {
+public abstract class RouteBuilder extends BuilderSupport implements Routes {
     private AtomicBoolean initialized = new AtomicBoolean(false);
     private RoutesType routeCollection = new RoutesType();
     private List<Route> routes = new ArrayList<Route>();

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java?rev=662722&r1=662721&r2=662722&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java Tue Jun  3 02:38:43 2008
@@ -34,6 +34,7 @@
 import org.apache.camel.Processor;
 import org.apache.camel.ResolveEndpointFailedException;
 import org.apache.camel.Route;
+import org.apache.camel.Routes;
 import org.apache.camel.RuntimeCamelException;
 import org.apache.camel.Service;
 import org.apache.camel.TypeConverter;
@@ -302,7 +303,7 @@
         }
     }
 
-    public void addRoutes(RouteBuilder builder) throws Exception {
+    public void addRoutes(Routes builder) throws Exception {
         // lets now add the routes from the builder
         builder.setContext(this);
         List<Route> routeList = builder.getRouteList();