예제 #1
0
 @Override
 protected void doStart() throws Exception {
   if (timer == null) {
     timer = new HashedWheelTimer();
   }
   super.doStart();
 }
예제 #2
0
  @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
     }
   }
 }
예제 #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);
 }
예제 #5
0
  @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;
      }
    }
  }
예제 #6
0
 @Override
 protected void doStop() throws Exception {
   timer.stop();
   timer = null;
   super.doStop();
 }
예제 #7
0
 @Override
 protected void doStop() throws Exception {
   ServiceHelper.stopService(cacheManagerFactory);
   super.doStop();
 }