@Beta public interface ListeningScheduledExecutorService extends ScheduledExecutorService, ListeningExecutorService
ScheduledExecutorService that returns ListenableFuture
instances from its ExecutorService methods. To create an instance
from an existing ScheduledExecutorService, call
MoreExecutors.listeningDecorator(ScheduledExecutorService).| Modifier and Type | Method and Description |
|---|---|
<V> ListenableScheduledFuture<V> |
schedule(Callable<V> callable,
long delay,
TimeUnit unit)
Creates and executes a ScheduledFuture that becomes enabled after the
given delay.
|
ListenableScheduledFuture<?> |
schedule(Runnable command,
long delay,
TimeUnit unit)
Creates and executes a one-shot action that becomes enabled
after the given delay.
|
ListenableScheduledFuture<?> |
scheduleAtFixedRate(Runnable command,
long initialDelay,
long period,
TimeUnit unit)
Creates and executes a periodic action that becomes enabled first
after the given initial delay, and subsequently with the given
period; that is executions will commence after
initialDelay then initialDelay+period, then
initialDelay + 2 * period, and so on.
|
ListenableScheduledFuture<?> |
scheduleWithFixedDelay(Runnable command,
long initialDelay,
long delay,
TimeUnit unit)
Creates and executes a periodic action that becomes enabled first
after the given initial delay, and subsequently with the
given delay between the termination of one execution and the
commencement of the next.
|
invokeAll, invokeAll, submit, submit, submitawaitTermination, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNowListenableScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit)
java.util.concurrent.ScheduledExecutorServiceschedule in interface ScheduledExecutorServicecommand - the task to executedelay - the time from now to delay executionunit - the time unit of the delay parameter<V> ListenableScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit)
java.util.concurrent.ScheduledExecutorServiceschedule in interface ScheduledExecutorServicecallable - the function to executedelay - the time from now to delay executionunit - the time unit of the delay parameterListenableScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit)
java.util.concurrent.ScheduledExecutorServicescheduleAtFixedRate in interface ScheduledExecutorServicecommand - the task to executeinitialDelay - the time to delay first executionperiod - the period between successive executionsunit - the time unit of the initialDelay and period parametersListenableScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit)
java.util.concurrent.ScheduledExecutorServicescheduleWithFixedDelay in interface ScheduledExecutorServicecommand - the task to executeinitialDelay - the time to delay first executiondelay - the delay between the termination of one
execution and the commencement of the nextunit - the time unit of the initialDelay and delay parametersCopyright © 2010-2014. All Rights Reserved.