Exemplo n.º 1
0
  @Override
  @After
  protected void tearDown() throws Exception {
    ServiceHelper.stopServices(context2, template2);

    super.tearDown();
  }
 protected void doStop() throws Exception {
   if (log.isDebugEnabled()) {
     log.debug("Stopping service pool: " + this);
   }
   for (BlockingQueue<Service> entry : pool.values()) {
     Collection<Service> values = new ArrayList<Service>();
     entry.drainTo(values);
     ServiceHelper.stopServices(values);
     entry.clear();
   }
   pool.clear();
 }
Exemplo n.º 3
0
  protected void doStop() throws Exception {

    // if we are stopping CamelContext then we are shutting down
    boolean isShutdownCamelContext = camelContext.isStopping();

    if (isShutdownCamelContext || isRemovingRoutes()) {
      // need to call onRoutesRemove when the CamelContext is shutting down or Route is shutdown
      for (LifecycleStrategy strategy : camelContext.getLifecycleStrategies()) {
        strategy.onRoutesRemove(routes);
      }
    }

    for (Route route : routes) {
      LOG.debug("Stopping services on route: {}", route.getId());

      // gather list of services to stop as we need to start child services as well
      Set<Service> services = gatherChildServices(route, true);

      // stop services
      stopChildService(route, services, isShutdownCamelContext);

      // stop the route itself
      if (isShutdownCamelContext) {
        ServiceHelper.stopAndShutdownServices(route);
      } else {
        ServiceHelper.stopServices(route);
      }

      // invoke callbacks on route policy
      if (route.getRouteContext().getRoutePolicyList() != null) {
        for (RoutePolicy routePolicy : route.getRouteContext().getRoutePolicyList()) {
          routePolicy.onStop(route);
        }
      }
      // fire event
      EventHelper.notifyRouteStopped(camelContext, route);
    }
    if (isRemovingRoutes()) {
      camelContext.removeRouteCollection(routes);
    }
    // need to warm up again
    warmUpDone.set(false);
  }
Exemplo n.º 4
0
 protected void doStop() throws Exception {
   ServiceHelper.stopServices(consumer, aggregationStrategy);
 }
Exemplo n.º 5
0
 protected void doStop() throws Exception {
   log.debug("Stopping consumer: {}", this);
   ServiceHelper.stopServices(processor);
 }
Exemplo n.º 6
0
 @Override
 protected void doStop() throws Exception {
   ServiceHelper.stopServices(processors, errorHandlers, aggregationStrategy);
 }
Exemplo n.º 7
0
 @Override
 protected void doStop() throws Exception {
   ServiceHelper.stopServices(consumers);
   consumers.clear();
   super.doStop();
 }
 @Override
 protected void doShutdown() throws Exception {
   ServiceHelper.stopServices(deadLetter, output, outputAsync);
 }
 @Override
 public void stop() throws Exception {
   ServiceHelper.stopServices(staticMap.values());
   ServiceHelper.stopServices(values());
   purge();
 }
Exemplo n.º 10
0
 @Override
 protected void doStop() throws Exception {
   ServiceHelper.stopServices(jsonMarshal, jsonUnmarshal, xmlMarshal, xmlUnmarshal);
 }
 @After
 public void tearDown() throws Exception {
   stopServices(consumer, template, camelContext);
 }
 @Override
 protected void doStop() throws Exception {
   callback.remove();
   interceptorDone.remove();
   ServiceHelper.stopServices(interceptor, target);
 }