Example #1
0
 @Override
 protected void doStart() throws Exception {
   if (timer == null) {
     timer = new HashedWheelTimer();
   }
   super.doStart();
 }
  @Override
  protected void doStart() throws Exception {
    super.doStart();

    if (scheduler == null) {
      createAndInitScheduler();
    }
  }
 /**
  * Disconnect all Pusher instances when stopping the component
  *
  * @throws Exception
  */
 @Override
 protected void doStop() throws Exception {
   LOG.info("Stopping {}", getClass().getSimpleName());
   super.doStop();
   // Disconnect from any currently connected apps
   for (Pusher pusher : apps.values()) {
     try {
       pusher.disconnect();
     } catch (Exception e) {
       // no-op
     }
   }
 }
Example #4
0
 @Override
 protected void doStart() throws Exception {
   super.doStart();
   if (cacheManagerFactory == null) {
     InputStream is = null;
     if (configurationFile != null) {
       is =
           ResourceHelper.resolveMandatoryResourceAsInputStream(
               getCamelContext().getClassResolver(), configurationFile);
     }
     cacheManagerFactory = new DefaultCacheManagerFactory(is, configurationFile);
   }
   ServiceHelper.startService(cacheManagerFactory);
 }
  @Override
  protected void doStop() throws Exception {
    super.doStop();

    if (scheduler != null) {
      AtomicInteger number =
          (AtomicInteger) scheduler.getContext().get(QuartzConstants.QUARTZ_CAMEL_JOBS_COUNT);
      if (number != null && number.get() > 0) {
        LOG.info(
            "Cannot shutdown scheduler: "
                + scheduler.getSchedulerName()
                + " as there are still "
                + number.get()
                + " jobs registered.");
      } else {
        LOG.info("Shutting down scheduler. (will wait for all jobs to complete first.)");
        scheduler.shutdown(true);
        scheduler = null;
      }
    }
  }
Example #6
0
 @Override
 protected void doStop() throws Exception {
   timer.stop();
   timer = null;
   super.doStop();
 }
Example #7
0
 @Override
 protected void doStop() throws Exception {
   ServiceHelper.stopService(cacheManagerFactory);
   super.doStop();
 }