Package java.util.concurrent

Examples of java.util.concurrent.ScheduledThreadPoolExecutor.scheduleWithFixedDelay()


        final ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(2);

        // Record latencies on a "regular" basis. This will tend to record semi-reliably at
        // each interval as long as the JVM doesn't stall.
        executor.scheduleWithFixedDelay(new Recorder(), RECORDING_INTERVAL, RECORDING_INTERVAL, TimeUnit.NANOSECONDS);

        // Regularly report o observations:
        executor.scheduleWithFixedDelay(new Reporter(), REPORTING_INTERVAL, REPORTING_INTERVAL, TimeUnit.NANOSECONDS);

        while (true);
View Full Code Here


        // Record latencies on a "regular" basis. This will tend to record semi-reliably at
        // each interval as long as the JVM doesn't stall.
        executor.scheduleWithFixedDelay(new Recorder(), RECORDING_INTERVAL, RECORDING_INTERVAL, TimeUnit.NANOSECONDS);

        // Regularly report o observations:
        executor.scheduleWithFixedDelay(new Reporter(), REPORTING_INTERVAL, REPORTING_INTERVAL, TimeUnit.NANOSECONDS);

        while (true);
    }
}
View Full Code Here

    @Override
    public void init() throws FalconException {
        WorkflowEngineFactory.getWorkflowEngine().registerListener(this);
        ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(1);
        executor.scheduleWithFixedDelay(new Monitor(), POLL_PERIODICITY_SECS, POLL_PERIODICITY_SECS, TimeUnit.SECONDS);
    }

    @Override
    public void destroy() throws FalconException {
    }
View Full Code Here

      }

      if(Config.getBooleanProperty("ENABLE_CONTENT_REINDEXATION_THREAD")) {
        try {
          ScheduledThreadPoolExecutor scheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor(1);
          scheduledThreadPoolExecutor.scheduleWithFixedDelay(new ContentReindexerThread(), Config.getIntProperty("EXEC_CONTENT_REINDEXATION_INIT_DELAY"), Config.getIntProperty("EXEC_CONTENT_REINDEXATION_DELAY"), TimeUnit.SECONDS);
        } catch (Exception e) {
          Logger.info(DotInitScheduler.class, e.toString());
        }
      } else {
            Logger.info(DotInitScheduler.class, "Automatic Content Reindexation Cron Thread schedule disabled on this server");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.