Code example for ListeningScheduledExecutorService

Methods: shutdown

0
  @Override 
  protected void shutDown() throws Exception {
    LOG.info("Stopping LogSaver..."); 
 
    kafkaCancel.cancel();
    scheduledExecutor.shutdown();
 
    logFileWriter.flush();
    logFileWriter.close();
  } 
 
  private void scheduleTasks(Set<Integer> partitions) throws Exception {
    // Don't schedule any tasks when not running 
    if (!isRunning()) {
      LOG.info("Not scheduling when stopping!"); 
      return; 
    } 
 
    subscribe(partitions);
 
Contextual code suggestions in your IDE  Get Codota for Java