activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r525540 - in /activemq/camel/trunk: camel-core/src/main/java/org/apache/camel/ camel-core/src/main/java/org/apache/camel/impl/ camel-core/src/test/java/org/apache/camel/component/pojo/ camel-core/src/test/java/org/apache/camel/component/poj...
Date Wed, 04 Apr 2007 15:36:00 GMT
Author: jstrachan
Date: Wed Apr  4 08:35:59 2007
New Revision: 525540

URL: http://svn.apache.org/viewvc?view=rev&rev=525540
Log:
further spring cleaning; zapped the activate/deactivate methods on CamelContext as we have
the start/stop from Service

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/impl/DefaultCamelContext.java
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/pojo/PojoRouteTest.java
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/pojo/timer/TimerRouteTest.java
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/queue/QueueRouteTest.java
    activemq/camel/trunk/camel-jbi/src/test/java/org/apache/camel/component/jbi/JbiTestSupport.java
    activemq/camel/trunk/camel-jbi/src/test/java/org/apache/camel/component/jbi/SendFromCamelToJbiAndBackToCamelTest.java
    activemq/camel/trunk/camel-jbi/src/test/java/org/apache/camel/component/jbi/SendFromCamelToJbiTest.java
    activemq/camel/trunk/camel-jbi/src/test/java/org/apache/camel/component/jbi/SendFromCamelToJbiThenRouteToAnotherJbiComponentTest.java
    activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteTest.java
    activemq/camel/trunk/camel-mina/src/test/java/org/apache/camel/component/mina/MinaVmTest.java
    activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
    activemq/camel/trunk/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRouteTest.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?view=diff&rev=525540&r1=525539&r2=525540
==============================================================================
--- 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 Wed Apr
 4 08:35:59 2007
@@ -70,20 +70,11 @@
     Endpoint resolveEndpoint(String uri);
 
     /**
-     * Activates all the starting endpoints in that were added as routes.
-     */
-    void activateEndpoints() throws Exception;
-
-    /**
-     * Deactivates all the starting endpoints in that were added as routes.
-     */
-    void deactivateEndpoints() throws Exception;
-
-    /**
      * Returns the collection of all active endpoints currently registered
      */
     Collection<Endpoint> getEndpoints();
 
+
     // Route Management Methods
     //-----------------------------------------------------------------------
     List<Route> getRoutes();
@@ -96,6 +87,7 @@
 
     void addRoutes(RouteFactory factory) throws Exception;
 
+    
     // Properties
     //-----------------------------------------------------------------------
     ExchangeConverter getExchangeConverter();

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?view=diff&rev=525540&r1=525539&r2=525540
==============================================================================
--- 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
Wed Apr  4 08:35:59 2007
@@ -169,34 +169,6 @@
         return answer;
     }
 
-    /**
-     * Activates all the starting endpoints in that were added as routes.
-     */
-    public void activateEndpoints() throws Exception {
-        if (routes != null) {
-            for (Route<Exchange> route : routes) {
-                Processor<Exchange> processor = route.getProcessor();
-                Consumer<Exchange> consumer = route.getEndpoint().createConsumer(processor);
-                if (consumer != null) {
-                    consumer.start();
-                    servicesToClose.add(consumer);
-                }
-                if (processor instanceof Service) {
-                    Service service = (Service) processor;
-                    service.start();
-                    servicesToClose.add(service);
-                }
-            }
-        }
-    }
-
-    /**
-     * Deactivates all the starting endpoints in that were added as routes.
-     */
-    public void deactivateEndpoints() throws Exception {
-        ServiceHelper.stopServices(servicesToClose);
-    }
-
     // Route Management Methods
     //-----------------------------------------------------------------------
     public List<Route> getRoutes() {
@@ -270,11 +242,25 @@
     //-----------------------------------------------------------------------
 
     protected void doStart() throws Exception {
-        activateEndpoints();
+        if (routes != null) {
+            for (Route<Exchange> route : routes) {
+                Processor<Exchange> processor = route.getProcessor();
+                Consumer<Exchange> consumer = route.getEndpoint().createConsumer(processor);
+                if (consumer != null) {
+                    consumer.start();
+                    servicesToClose.add(consumer);
+                }
+                if (processor instanceof Service) {
+                    Service service = (Service) processor;
+                    service.start();
+                    servicesToClose.add(service);
+                }
+            }
+        }
     }
 
     protected void doStop() throws Exception {
-        deactivateEndpoints();
+        ServiceHelper.stopServices(servicesToClose);
     }
 
     /**

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/pojo/PojoRouteTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/pojo/PojoRouteTest.java?view=diff&rev=525540&r1=525539&r2=525540
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/pojo/PojoRouteTest.java
(original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/pojo/PojoRouteTest.java
Wed Apr  4 08:35:59 2007
@@ -55,7 +55,7 @@
         });
 
         
-        container.activateEndpoints();
+        container.start();
 
         // now lets fire in a message
         PojoConsumer consumer = component.getConsumer("hello");        
@@ -64,6 +64,6 @@
         assertEquals("Good Bye!", rc);
         assertEquals(1, hitCount.get());
         
-        container.deactivateEndpoints();
+        container.stop();
     }
 }

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/pojo/timer/TimerRouteTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/pojo/timer/TimerRouteTest.java?view=diff&rev=525540&r1=525539&r2=525540
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/pojo/timer/TimerRouteTest.java
(original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/pojo/timer/TimerRouteTest.java
Wed Apr  4 08:35:59 2007
@@ -53,12 +53,12 @@
             }
         });
         
-        container.activateEndpoints();
+        container.start();
 
         // now lets wait for the timer to fire a few times.
         Thread.sleep(1000*2);
         assertTrue("", hitCount.get()>= 3 );
         
-        container.deactivateEndpoints();
+        container.stop();
     }
 }

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/queue/QueueRouteTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/queue/QueueRouteTest.java?view=diff&rev=525540&r1=525539&r2=525540
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/queue/QueueRouteTest.java
(original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/queue/QueueRouteTest.java
Wed Apr  4 08:35:59 2007
@@ -54,7 +54,7 @@
         });
 
         
-        container.activateEndpoints();
+        container.start();
         
         // now lets fire in a message
         Endpoint<Exchange> endpoint = container.resolveEndpoint("queue:test.a");
@@ -68,6 +68,6 @@
         boolean received = latch.await(5, TimeUnit.SECONDS);
         assertTrue("Did not receive the message!", received);
 
-        container.deactivateEndpoints();
+        container.stop();
     }
 }

Modified: activemq/camel/trunk/camel-jbi/src/test/java/org/apache/camel/component/jbi/JbiTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jbi/src/test/java/org/apache/camel/component/jbi/JbiTestSupport.java?view=diff&rev=525540&r1=525539&r2=525540
==============================================================================
--- activemq/camel/trunk/camel-jbi/src/test/java/org/apache/camel/component/jbi/JbiTestSupport.java
(original)
+++ activemq/camel/trunk/camel-jbi/src/test/java/org/apache/camel/component/jbi/JbiTestSupport.java
Wed Apr  4 08:35:59 2007
@@ -104,13 +104,13 @@
         endpoint = camelContext.resolveEndpoint(startEndpointUri);
         assertNotNull("No endpoint found!", endpoint);
 
-        camelContext.activateEndpoints();
+        camelContext.start();
     }
 
     @Override
     protected void tearDown() throws Exception {
         client.stop();
-        camelContext.deactivateEndpoints();
+        camelContext.stop();
         super.tearDown();
     }
 

Modified: activemq/camel/trunk/camel-jbi/src/test/java/org/apache/camel/component/jbi/SendFromCamelToJbiAndBackToCamelTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jbi/src/test/java/org/apache/camel/component/jbi/SendFromCamelToJbiAndBackToCamelTest.java?view=diff&rev=525540&r1=525539&r2=525540
==============================================================================
--- activemq/camel/trunk/camel-jbi/src/test/java/org/apache/camel/component/jbi/SendFromCamelToJbiAndBackToCamelTest.java
(original)
+++ activemq/camel/trunk/camel-jbi/src/test/java/org/apache/camel/component/jbi/SendFromCamelToJbiAndBackToCamelTest.java
Wed Apr  4 08:35:59 2007
@@ -73,6 +73,6 @@
 
     @Override
     protected void tearDown() throws Exception {
-        camelContext.deactivateEndpoints();
+        camelContext.stop();
     }
 }

Modified: activemq/camel/trunk/camel-jbi/src/test/java/org/apache/camel/component/jbi/SendFromCamelToJbiTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jbi/src/test/java/org/apache/camel/component/jbi/SendFromCamelToJbiTest.java?view=diff&rev=525540&r1=525539&r2=525540
==============================================================================
--- activemq/camel/trunk/camel-jbi/src/test/java/org/apache/camel/component/jbi/SendFromCamelToJbiTest.java
(original)
+++ activemq/camel/trunk/camel-jbi/src/test/java/org/apache/camel/component/jbi/SendFromCamelToJbiTest.java
Wed Apr  4 08:35:59 2007
@@ -65,6 +65,6 @@
 
     @Override
     protected void tearDown() throws Exception {
-        camelContext.deactivateEndpoints();
+        camelContext.stop();
     }
 }

Modified: activemq/camel/trunk/camel-jbi/src/test/java/org/apache/camel/component/jbi/SendFromCamelToJbiThenRouteToAnotherJbiComponentTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jbi/src/test/java/org/apache/camel/component/jbi/SendFromCamelToJbiThenRouteToAnotherJbiComponentTest.java?view=diff&rev=525540&r1=525539&r2=525540
==============================================================================
--- activemq/camel/trunk/camel-jbi/src/test/java/org/apache/camel/component/jbi/SendFromCamelToJbiThenRouteToAnotherJbiComponentTest.java
(original)
+++ activemq/camel/trunk/camel-jbi/src/test/java/org/apache/camel/component/jbi/SendFromCamelToJbiThenRouteToAnotherJbiComponentTest.java
Wed Apr  4 08:35:59 2007
@@ -65,6 +65,6 @@
 
     @Override
     protected void tearDown() throws Exception {
-        camelContext.deactivateEndpoints();
+        camelContext.stop();
     }
 }

Modified: activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteTest.java?view=diff&rev=525540&r1=525539&r2=525540
==============================================================================
--- activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteTest.java
(original)
+++ activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteTest.java
Wed Apr  4 08:35:59 2007
@@ -115,12 +115,12 @@
         endpoint = container.resolveEndpoint("jms:queue:test.a");
         assertNotNull("No endpoint found!", endpoint);
 
-        container.activateEndpoints();
+        container.start();
     }
 
     @Override
     protected void tearDown() throws Exception {
         client.stop();
-        container.deactivateEndpoints();
+        container.stop();
     }
 }

Modified: activemq/camel/trunk/camel-mina/src/test/java/org/apache/camel/component/mina/MinaVmTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-mina/src/test/java/org/apache/camel/component/mina/MinaVmTest.java?view=diff&rev=525540&r1=525539&r2=525540
==============================================================================
--- activemq/camel/trunk/camel-mina/src/test/java/org/apache/camel/component/mina/MinaVmTest.java
(original)
+++ activemq/camel/trunk/camel-mina/src/test/java/org/apache/camel/component/mina/MinaVmTest.java
Wed Apr  4 08:35:59 2007
@@ -59,7 +59,7 @@
     @Override
     protected void setUp() throws Exception {
         container.addRoutes(createRouteBuilder());
-        container.activateEndpoints();
+        container.start();
     }
 
 
@@ -68,7 +68,7 @@
         if (producer != null) {
             producer.stop();
         }
-        container.deactivateEndpoints();
+        container.stop();
     }
 
     protected RouteBuilder createRouteBuilder() {

Modified: activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java?view=diff&rev=525540&r1=525539&r2=525540
==============================================================================
--- activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
(original)
+++ activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
Wed Apr  4 08:35:59 2007
@@ -64,11 +64,11 @@
         installRoutes();
 
         // now lets activate the routes
-        getContext().activateEndpoints();
+        getContext().start();
     }
 
     public void destroy() throws Exception {
-        getContext().deactivateEndpoints();
+        getContext().stop();
     }
 
     // Properties

Modified: activemq/camel/trunk/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRouteTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRouteTest.java?view=diff&rev=525540&r1=525539&r2=525540
==============================================================================
--- activemq/camel/trunk/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRouteTest.java
(original)
+++ activemq/camel/trunk/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRouteTest.java
Wed Apr  4 08:35:59 2007
@@ -133,7 +133,7 @@
             assertNotNull("No endpoint found!", endpoint);
         }
 
-        container.activateEndpoints();
+        container.start();
     }
 
     protected String getUriPrefix() {
@@ -146,6 +146,6 @@
     @Override
     protected void tearDown() throws Exception {
         client.stop();
-        container.deactivateEndpoints();
+        container.stop();
     }
 }



Mime
View raw message