Class ExecutorServiceScheduler

  • All Implemented Interfaces:
    Scheduler, java.io.Serializable

    final class ExecutorServiceScheduler
    extends java.lang.Object
    implements Scheduler, java.io.Serializable
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) static java.util.logging.Logger logger  
      (package private) java.util.concurrent.ScheduledExecutorService scheduledExecutorService  
      (package private) static long serialVersionUID  
    • Constructor Summary

      Constructors 
      Constructor Description
      ExecutorServiceScheduler​(java.util.concurrent.ScheduledExecutorService scheduledExecutorService)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.concurrent.Future<?> schedule​(java.util.concurrent.Executor executor, java.lang.Runnable command, long delay, java.util.concurrent.TimeUnit unit)
      Returns a future that will submit the task to the given executor after the given delay.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • logger

        static final java.util.logging.Logger logger
      • scheduledExecutorService

        final java.util.concurrent.ScheduledExecutorService scheduledExecutorService
    • Constructor Detail

      • ExecutorServiceScheduler

        ExecutorServiceScheduler​(java.util.concurrent.ScheduledExecutorService scheduledExecutorService)
    • Method Detail

      • schedule

        public java.util.concurrent.Future<?> schedule​(java.util.concurrent.Executor executor,
                                                       java.lang.Runnable command,
                                                       long delay,
                                                       java.util.concurrent.TimeUnit unit)
        Description copied from interface: Scheduler
        Returns a future that will submit the task to the given executor after the given delay.
        Specified by:
        schedule in interface Scheduler
        Parameters:
        executor - the executor to run the task
        command - the runnable task to schedule
        delay - how long to delay, in units of unit
        unit - a TimeUnit determining how to interpret the delay parameter
        Returns:
        a scheduled future representing pending submission of the task