camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r810535 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/impl/ camel-core/src/main/java/org/apache/camel/management/ camel-core/src/main/java/org/apache/camel/management/mbean/ camel-core/src/main/java/org/apache/camel/processor...
Date Wed, 02 Sep 2009 14:54:22 GMT
Author: davsclaus
Date: Wed Sep  2 14:54:21 2009
New Revision: 810535

URL: http://svn.apache.org/viewvc?rev=810535&view=rev
Log:
CAMEL-1980: Overhaul of JMX. Added routeId attribute for consumer and processors.

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/RouteService.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/management/DefaultManagementLifecycleStrategy.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedConsumer.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedProcessor.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedProducer.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedScheduledPollConsumer.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedService.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DefaultChannel.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/spi/LifecycleStrategy.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/impl/DummyLifecycleStrategy.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/management/ManagedSendProcessorTest.java
    camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/DummyLifecycleStrategy.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java?rev=810535&r1=810534&r2=810535&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java Wed
Sep  2 14:54:21 2009
@@ -623,7 +623,7 @@
         if (object instanceof Service) {
             Service service = (Service) object;
             for (LifecycleStrategy strategy : lifecycleStrategies) {
-                strategy.onServiceAdd(this, service);
+                strategy.onServiceAdd(this, service, null);
             }
             servicesToClose.add(service);
         }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/RouteService.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/RouteService.java?rev=810535&r1=810534&r2=810535&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/RouteService.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/RouteService.java Wed Sep 
2 14:54:21 2009
@@ -140,16 +140,9 @@
     }
 
     protected void startChildService(Route route, List<Service> services) throws Exception
{
-        boolean first = true;
         for (Service service : services) {
             for (LifecycleStrategy strategy : camelContext.getLifecycleStrategies()) {
-                // the first one is the input consumer
-                if (first && service instanceof Consumer) {
-                    strategy.onRouteConsumerAdd(route, (Consumer) service);
-                } else {
-                    strategy.onServiceAdd(camelContext, service);
-                    first = false;
-                }
+                strategy.onServiceAdd(camelContext, service, route);
             }
             ServiceHelper.startService(service);
             addChildService(service);
@@ -157,16 +150,9 @@
     }
 
     protected void stopChildService(Route route, List<Service> services) throws Exception
{
-        boolean first = true;
         for (Service service : services) {
             for (LifecycleStrategy strategy : camelContext.getLifecycleStrategies()) {
-                // the first one is the input consumer
-                if (first && service instanceof Consumer) {
-                    strategy.onRouteConsumerRemove(route, (Consumer) service);
-                } else {
-                    strategy.onServiceRemove(camelContext, service);
-                    first = false;
-                }
+                strategy.onServiceRemove(camelContext, service, route);
             }
             ServiceHelper.stopService(service);
             removeChildService(service);

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/management/DefaultManagementLifecycleStrategy.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/management/DefaultManagementLifecycleStrategy.java?rev=810535&r1=810534&r2=810535&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/management/DefaultManagementLifecycleStrategy.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/management/DefaultManagementLifecycleStrategy.java
Wed Sep  2 14:54:21 2009
@@ -44,6 +44,7 @@
 import org.apache.camel.management.mbean.ManagedRoute;
 import org.apache.camel.management.mbean.ManagedScheduledPollConsumer;
 import org.apache.camel.management.mbean.ManagedSendProcessor;
+import org.apache.camel.management.mbean.ManagedService;
 import org.apache.camel.management.mbean.ManagedThrottler;
 import org.apache.camel.management.mbean.ManagedTracer;
 import org.apache.camel.model.AOPDefinition;
@@ -144,6 +145,7 @@
         }
     }
 
+    @SuppressWarnings("unchecked")
     private Object getManagedObjectForComponent(String name, Component component) {
         if (component instanceof ManagementAware) {
             return ((ManagementAware) component).getManagedObject(component);
@@ -174,7 +176,6 @@
         }
     }
 
-    @SuppressWarnings("unchecked")
     public void onEndpointRemove(Endpoint endpoint) {
         // the agent hasn't been started
         if (!initialized) {
@@ -189,6 +190,7 @@
         }
     }
 
+    @SuppressWarnings("unchecked")
     private Object getManagedObjectForEndpoint(Endpoint endpoint) {
         if (endpoint instanceof ManagementAware) {
             return ((ManagementAware) endpoint).getManagedObject(endpoint);
@@ -199,7 +201,7 @@
         }
     }
 
-    public void onServiceAdd(CamelContext context, Service service) {
+    public void onServiceAdd(CamelContext context, Service service, Route route) {
         // services can by any kind of misc type but also processors
         // so we have special logic when its a processor
 
@@ -208,7 +210,7 @@
             return;
         }
 
-        Object managedObject = getManagedObjectForService(context, service);
+        Object managedObject = getManagedObjectForService(context, service, route);
         if (managedObject == null) {
             // service should not be managed
             return;
@@ -229,13 +231,13 @@
         }
     }
 
-    public void onServiceRemove(CamelContext context, Service service) {
+    public void onServiceRemove(CamelContext context, Service service, Route route) {
         // the agent hasn't been started
         if (!initialized) {
             return;
         }
 
-        Object managedObject = getManagedObjectForService(context, service);
+        Object managedObject = getManagedObjectForService(context, service, route);
         if (managedObject != null) {
             try {
                 getStrategy().unmanageObject(managedObject);
@@ -246,28 +248,35 @@
     }
 
     @SuppressWarnings("unchecked")
-    private Object getManagedObjectForService(CamelContext context, Service service) {
+    private Object getManagedObjectForService(CamelContext context, Service service, Route
route) {
+        ManagedService answer = null;
+
         if (service instanceof ManagementAware) {
             return ((ManagementAware) service).getManagedObject(service);
         } else if (service instanceof Tracer) {
             // special for tracer
             return new ManagedTracer(context, (Tracer) service);
         } else if (service instanceof Producer) {
-            return new ManagedProducer(context, (Producer) service);
+            answer = new ManagedProducer(context, (Producer) service);
         } else if (service instanceof ScheduledPollConsumer) {
-            return new ManagedScheduledPollConsumer(context, (ScheduledPollConsumer) service);
+            answer = new ManagedScheduledPollConsumer(context, (ScheduledPollConsumer) service);
         } else if (service instanceof Consumer) {
-            return new ManagedConsumer(context, (Consumer) service);
+            answer = new ManagedConsumer(context, (Consumer) service);
         } else if (service instanceof Processor) {
             // special for processors
-            return getManagedObjectForProcessor(context, (Processor) service);
+            return getManagedObjectForProcessor(context, (Processor) service, route);
         }
 
-        // not supported
-        return null;
+        if (answer != null) {
+            answer.setRoute(route);
+            return answer;
+        } else {
+            // not supported
+            return null;
+        }
     }
 
-    private Object getManagedObjectForProcessor(CamelContext context, Processor processor)
{
+    private Object getManagedObjectForProcessor(CamelContext context, Processor processor,
Route route) {
         // a bit of magic here as the processors we want to manage have already been registered
         // in the wrapped processors map when Camel have instrumented the route on route
initialization
         // so the idea is now to only manage the processors from the map
@@ -278,7 +287,7 @@
         }
 
         // get the managed object as it can be a specialized type such as a Delayer/Throttler
etc.
-        Object managedObject = createManagedObjectForProcessor(context, processor, holder.getKey());
+        Object managedObject = createManagedObjectForProcessor(context, processor, holder.getKey(),
route);
         // only manage if we have a name for it as otherwise we do not want to manage it
anyway
         if (managedObject != null) {
             // is it a performance counter then we need to set our counter
@@ -294,59 +303,25 @@
         return managedObject;
     }
 
-    private Object createManagedObjectForProcessor(CamelContext context, Processor processor,
ProcessorDefinition definition) {
+    private Object createManagedObjectForProcessor(CamelContext context, Processor processor,
+                                                   ProcessorDefinition definition, Route
route) {
+
+        ManagedProcessor answer = null;
         if (processor instanceof Delayer) {
-            return new ManagedDelayer(context, (Delayer) processor, definition);
+            answer = new ManagedDelayer(context, (Delayer) processor, definition);
         } else if (processor instanceof Throttler) {
-            return new ManagedThrottler(context, (Throttler) processor, definition);
+            answer = new ManagedThrottler(context, (Throttler) processor, definition);
         } else if (processor instanceof SendProcessor) {
-            return new ManagedSendProcessor(context, (SendProcessor) processor, definition);
+            answer = new ManagedSendProcessor(context, (SendProcessor) processor, definition);
         }
 
-        // fallback to a generic processor
-        return new ManagedProcessor(context, processor, definition);
-    }
-
-    public void onRouteConsumerAdd(Route route, Consumer consumer) {
-        // the agent hasn't been started
-        if (!initialized) {
-            return;
+        if (answer == null) {
+            // fallback to a generic processor
+            answer = new ManagedProcessor(context, processor, definition);
         }
 
-        Object managedObject;
-        if (consumer instanceof ManagementAware) {
-            managedObject = ((ManagementAware) consumer).getManagedObject(consumer);
-        } else if (consumer instanceof ScheduledPollConsumer) {
-            managedObject = new ManagedScheduledPollConsumer(route.getRouteContext().getCamelContext(),
(ScheduledPollConsumer) consumer, route);
-        } else {
-            managedObject = new ManagedConsumer(route.getRouteContext().getCamelContext(),
consumer, route);
-        }
-        try {
-            getStrategy().manageObject(managedObject);
-        } catch (Exception e) {
-            LOG.warn("Could not register consumer MBean.", e);
-        }
-    }
-
-    public void onRouteConsumerRemove(Route route, Consumer consumer) {
-        // the agent hasn't been started
-        if (!initialized) {
-            return;
-        }
-
-        Object managedObject;
-        if (consumer instanceof ManagementAware) {
-            managedObject = ((ManagementAware) consumer).getManagedObject(consumer);
-        } else if (consumer instanceof ScheduledPollConsumer) {
-            managedObject = new ManagedScheduledPollConsumer(route.getRouteContext().getCamelContext(),
(ScheduledPollConsumer) consumer, route);
-        } else {
-            managedObject = new ManagedConsumer(route.getRouteContext().getCamelContext(),
consumer, route);
-        }
-        try {
-            getStrategy().unmanageObject(managedObject);
-        } catch (Exception e) {
-            LOG.warn("Could not register consumer MBean.", e);
-        }
+        answer.setRoute(route);
+        return answer;
     }
 
     public void onRoutesAdd(Collection<Route> routes) {

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedConsumer.java?rev=810535&r1=810534&r2=810535&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedConsumer.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedConsumer.java
Wed Sep  2 14:54:21 2009
@@ -18,7 +18,6 @@
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.Consumer;
-import org.apache.camel.Route;
 import org.springframework.jmx.export.annotation.ManagedAttribute;
 import org.springframework.jmx.export.annotation.ManagedResource;
 
@@ -29,37 +28,19 @@
 public class ManagedConsumer extends ManagedService {
 
     private final Consumer consumer;
-    private final Route route;
 
     public ManagedConsumer(CamelContext context, Consumer consumer) {
-        this(context, consumer, null);
-    }
-
-    public ManagedConsumer(CamelContext context, Consumer consumer, Route route) {
         super(context, consumer);
         this.consumer = consumer;
-        this.route = route;
     }
 
     public Consumer getConsumer() {
         return consumer;
     }
 
-    public Route getRoute() {
-        return route;
-    }
-
     @ManagedAttribute(description = "Endpoint Uri")
     public String getEndpointUri() {
         return consumer.getEndpoint().getEndpointUri();
     }
 
-    @ManagedAttribute(description = "Route id")
-    public String getRouteId() {
-        if (route != null) {
-            return route.getId();
-        }
-        return null;
-    }
-
 }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedProcessor.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedProcessor.java?rev=810535&r1=810534&r2=810535&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedProcessor.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedProcessor.java
Wed Sep  2 14:54:21 2009
@@ -19,6 +19,7 @@
 import org.apache.camel.CamelContext;
 import org.apache.camel.Processor;
 import org.apache.camel.ServiceStatus;
+import org.apache.camel.Route;
 import org.apache.camel.impl.ServiceSupport;
 import org.apache.camel.model.ProcessorDefinition;
 import org.apache.camel.model.RouteDefinition;
@@ -34,15 +35,14 @@
     private final CamelContext context;
     private final Processor processor;
     private final ProcessorDefinition definition;
-    private final String routeId;
     private final String id;
+    private Route route;
 
     public ManagedProcessor(CamelContext context, Processor processor, ProcessorDefinition
definition) {
         super(context.getManagementStrategy());
         this.context = context;
         this.processor = processor;
         this.definition = definition;
-        this.routeId = doGetRouteId(definition);
         this.id = definition.idOrCreate(context.getNodeIdFactory());
     }
 
@@ -58,6 +58,14 @@
         return definition;
     }
 
+    public Route getRoute() {
+        return route;
+    }
+
+    public void setRoute(Route route) {
+        this.route = route;
+    }
+
     @ManagedAttribute(description = "Processor State")
     public String getState() {
         // must use String type to be sure remote JMX can read the attribute without requiring
Camel classes.
@@ -81,7 +89,10 @@
 
     @ManagedAttribute(description = "Route id")
     public String getRouteId() {
-        return routeId;
+        if (route != null) {
+            return route.getId();
+        }
+        return null;
     }
 
     @ManagedAttribute(description = "Processor id")
@@ -89,16 +100,4 @@
         return id;
     }
 
-    private static String doGetRouteId(ProcessorDefinition definition) {
-        if (definition == null) {
-            return null;
-        }
-
-        if (definition instanceof RouteDefinition) {
-            return definition.getId();
-        } else {
-            return doGetRouteId(definition.getParent());
-        }
-    }
-
 }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedProducer.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedProducer.java?rev=810535&r1=810534&r2=810535&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedProducer.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedProducer.java
Wed Sep  2 14:54:21 2009
@@ -18,6 +18,7 @@
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.Producer;
+import org.apache.camel.Route;
 import org.springframework.jmx.export.annotation.ManagedAttribute;
 import org.springframework.jmx.export.annotation.ManagedResource;
 

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedScheduledPollConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedScheduledPollConsumer.java?rev=810535&r1=810534&r2=810535&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedScheduledPollConsumer.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedScheduledPollConsumer.java
Wed Sep  2 14:54:21 2009
@@ -19,7 +19,6 @@
 import java.util.concurrent.TimeUnit;
 
 import org.apache.camel.CamelContext;
-import org.apache.camel.Route;
 import org.apache.camel.impl.ScheduledPollConsumer;
 import org.springframework.jmx.export.annotation.ManagedAttribute;
 import org.springframework.jmx.export.annotation.ManagedResource;
@@ -37,11 +36,6 @@
         this.consumer = consumer;
     }
 
-    public ManagedScheduledPollConsumer(CamelContext context, ScheduledPollConsumer consumer,
Route route) {
-        super(context, consumer, route);
-        this.consumer = consumer;
-    }
-
     public ScheduledPollConsumer getConsumer() {
         return consumer;
     }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedService.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedService.java?rev=810535&r1=810534&r2=810535&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedService.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedService.java
Wed Sep  2 14:54:21 2009
@@ -17,6 +17,7 @@
 package org.apache.camel.management.mbean;
 
 import org.apache.camel.CamelContext;
+import org.apache.camel.Route;
 import org.apache.camel.Service;
 import org.apache.camel.ServiceStatus;
 import org.apache.camel.impl.ServiceSupport;
@@ -29,6 +30,7 @@
 
     private CamelContext context;
     private Service service;
+    private Route route;
 
     public ManagedService(CamelContext context, Service service) {
         this.context = context;
@@ -43,6 +45,14 @@
         return context;
     }
 
+    public Route getRoute() {
+        return route;
+    }
+
+    public void setRoute(Route route) {
+        this.route = route;
+    }
+
     @ManagedAttribute(description = "Service State")
     public String getState() {
         // must use String type to be sure remote JMX can read the attribute without requiring
Camel classes.
@@ -64,6 +74,14 @@
         return context.getName();
     }
 
+    @ManagedAttribute(description = "Route id")
+    public String getRouteId() {
+        if (route != null) {
+            return route.getId();
+        }
+        return null;
+    }
+
     @ManagedOperation(description = "Start Service")
     public void start() throws Exception {
         service.start();

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DefaultChannel.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DefaultChannel.java?rev=810535&r1=810534&r2=810535&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DefaultChannel.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DefaultChannel.java Wed
Sep  2 14:54:21 2009
@@ -185,7 +185,7 @@
         // which we must manage as well
         for (LifecycleStrategy strategy : camelContext.getLifecycleStrategies()) {
             if (tracer instanceof Service) {
-                strategy.onServiceAdd(camelContext, (Service) tracer);
+                strategy.onServiceAdd(camelContext, (Service) tracer, null);
             }
         }
 

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/spi/LifecycleStrategy.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/LifecycleStrategy.java?rev=810535&r1=810534&r2=810535&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/spi/LifecycleStrategy.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/spi/LifecycleStrategy.java Wed Sep
 2 14:54:21 2009
@@ -20,7 +20,6 @@
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.Component;
-import org.apache.camel.Consumer;
 import org.apache.camel.Endpoint;
 import org.apache.camel.Route;
 import org.apache.camel.Service;
@@ -79,26 +78,18 @@
      *
      * @param context the camel context
      * @param service the added service
+     * @param route   the route the service belongs to if any possible to determine
      */
-    void onServiceAdd(CamelContext context, Service service);
-
-    /**
-     * Notification on adding a {@link Consumer} as input to a given {@link Route}
-     *
-     * @param route
-     * @param consumer      the consumer
-     */
-    void onRouteConsumerAdd(Route route, Consumer consumer);
-
-    void onRouteConsumerRemove(Route route, Consumer consumer);
+    void onServiceAdd(CamelContext context, Service service, Route route);
 
     /**
      * Notification on removing a {@link Service}.
      *
      * @param context the camel context
      * @param service the removed service
+     * @param route   the route the service belongs to if any possible to determine
      */
-    void onServiceRemove(CamelContext context, Service service);
+    void onServiceRemove(CamelContext context, Service service, Route route);
 
     /**
      * Notification on adding {@link Route}(s).
@@ -121,6 +112,4 @@
      */
     void onRouteContextCreate(RouteContext routeContext);
 
-    // TODO: Add more stop methods and also consider always having CamelContext as parameter
-
 }

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/impl/DummyLifecycleStrategy.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/impl/DummyLifecycleStrategy.java?rev=810535&r1=810534&r2=810535&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/impl/DummyLifecycleStrategy.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/impl/DummyLifecycleStrategy.java
Wed Sep  2 14:54:21 2009
@@ -60,22 +60,14 @@
         events.add("onEndpointRemove");
     }
 
-    public void onServiceAdd(CamelContext context, Service service) {
+    public void onServiceAdd(CamelContext context, Service service, Route route) {
         events.add("onServiceAdd");
     }
 
-    public void onServiceRemove(CamelContext context, Service service) {
+    public void onServiceRemove(CamelContext context, Service service, Route route) {
         events.add("onServiceRemove");
     }
 
-    public void onRouteConsumerAdd(Route route, Consumer consumer) {
-        events.add("onRouteConsumerAdd");
-    }
-
-    public void onRouteConsumerRemove(Route route, Consumer consumer) {
-        events.add("onRouteConsumerRemove");
-    }
-
     public void onRoutesAdd(Collection<Route> routes) {
         events.add("onRoutesAdd");
     }

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/management/ManagedSendProcessorTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/management/ManagedSendProcessorTest.java?rev=810535&r1=810534&r2=810535&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/management/ManagedSendProcessorTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/management/ManagedSendProcessorTest.java
Wed Sep  2 14:54:21 2009
@@ -55,6 +55,10 @@
         // get the object name for the delayer
         ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=processors,name=\"mysend\"");
 
+        // should be on route1
+        String routeId = (String) mbeanServer.getAttribute(on, "RouteId");
+        assertEquals("route1", routeId);
+
         // send it somewhere else
         mbeanServer.invoke(on, "changeDestination", new Object[]{"direct:foo"}, new String[]{"java.lang.String"});
 

Modified: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/DummyLifecycleStrategy.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/DummyLifecycleStrategy.java?rev=810535&r1=810534&r2=810535&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/DummyLifecycleStrategy.java
(original)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/DummyLifecycleStrategy.java
Wed Sep  2 14:54:21 2009
@@ -30,7 +30,6 @@
  * Dummy LifecycleStrategy for LifecycleStrategy injection test.
  *
  * @version $Revision$
- *
  */
 public class DummyLifecycleStrategy implements LifecycleStrategy {
 
@@ -52,10 +51,10 @@
     public void onEndpointRemove(Endpoint endpoint) {
     }
 
-    public void onServiceAdd(CamelContext camelContext, Service service) {
+    public void onServiceAdd(CamelContext camelContext, Service service, Route route) {
     }
 
-    public void onServiceRemove(CamelContext camelContext, Service service) {
+    public void onServiceRemove(CamelContext camelContext, Service service, Route route)
{
     }
 
     public void onRouteContextCreate(RouteContext routeContext) {



Mime
View raw message