public static ScheduledExecutorService createScheduler(){
  final ScheduledExecutorService scheduler=Executors.newScheduledThreadPool(1,new DaemonThreadFactory(DEFAULT_SCHEDULER_NAME));
  SCHEDULERS.add(scheduler);
  return scheduler;
}

public static ScheduledExecutorService createScheduler ( ) { final ScheduledExecutorService scheduler = Executors . newScheduledThreadPool ( 1 , new DaemonThreadFactory ( DEFAULT_SCHEDULER_NAME ) ) ; SCHEDULERS . add ( scheduler ) ; return scheduler ; }
creates a single - threaded scheduler that is registered by this class in order to shut it down later ( when it becomes necessary ) .
