Ejemplo n.º 1
0
 protected void stopChildService(Route route, Set<Service> services, boolean shutdown)
     throws Exception {
   for (Service service : services) {
     LOG.debug(
         "{} child service on route: {} -> {}",
         new Object[] {shutdown ? "Shutting down" : "Stopping", route.getId(), service});
     if (service instanceof ErrorHandler) {
       // special for error handlers
       for (LifecycleStrategy strategy : camelContext.getLifecycleStrategies()) {
         strategy.onErrorHandlerRemove(
             route.getRouteContext(),
             (Processor) service,
             route.getRouteContext().getRoute().getErrorHandlerBuilder());
       }
     } else {
       for (LifecycleStrategy strategy : camelContext.getLifecycleStrategies()) {
         strategy.onServiceRemove(camelContext, service, route);
       }
     }
     if (shutdown) {
       ServiceHelper.stopAndShutdownService(service);
     } else {
       ServiceHelper.stopService(service);
     }
     removeChildService(service);
   }
 }
Ejemplo n.º 2
0
 @Override
 protected void doStop() throws Exception {
   LOG.info("Stopping " + notifier);
   managementStrategy.removeEventNotifier(notifier);
   ServiceHelper.stopAndShutdownService(notifier);
 }