Code example for ScheduledThreadPoolExecutor

0
  } 
 
  @Override 
  public void serviceStart() throws Exception {
    if (planFollower != null) {
      scheduledExecutorService = new ScheduledThreadPoolExecutor(1);
      scheduledExecutorService.scheduleWithFixedDelay(planFollower, 0L,
          planStepSize, TimeUnit.MILLISECONDS);
    } 
    super.serviceStart(); 
  } 
 
  @Override 
  public void serviceStop() { 
    // Stop the plan follower 
    if (scheduledExecutorService != null
        && !scheduledExecutorService.isShutdown()) {
      scheduledExecutorService.shutdown();
    } 
    // Clear the plans 
Connect your IDE to all the code out there  Get Codota for Java