@GwtIncompatible 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 |
|---|---|
default <V> ListenableScheduledFuture<V> |
schedule(Callable<V> callable,
Duration delay)
Duration-based overload of
schedule(Callable, long, TimeUnit). |
<V> ListenableScheduledFuture<V> |
schedule(Callable<V> callable,
long delay,
TimeUnit unit)
Creates and executes a ScheduledFuture that becomes enabled after the
given delay.
|
default ListenableScheduledFuture<?> |
schedule(Runnable command,
Duration delay)
Duration-based overload of
schedule(Runnable, long, TimeUnit). |
ListenableScheduledFuture<?> |
schedule(Runnable command,
long delay,
TimeUnit unit)
Creates and executes a one-shot action that becomes enabled
after the given delay.
|
default ListenableScheduledFuture<?> |
scheduleAtFixedRate(Runnable command,
Duration initialDelay,
Duration period)
Duration-based overload of
scheduleAtFixedRate(Runnable, long, long, TimeUnit). |
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. |
default ListenableScheduledFuture<?> |
scheduleWithFixedDelay(Runnable command,
Duration initialDelay,
Duration delay)
Duration-based overload of
scheduleWithFixedDelay(Runnable, long, long, TimeUnit). |
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 parameterget() method will return
null upon completiondefault ListenableScheduledFuture<?> schedule(Runnable command, Duration delay)
schedule(Runnable, long, TimeUnit).<V> ListenableScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit)
java.util.concurrent.ScheduledExecutorServiceschedule in interface ScheduledExecutorServiceV - the type of the callable's resultcallable - the function to executedelay - the time from now to delay executionunit - the time unit of the delay parameterdefault <V> ListenableScheduledFuture<V> schedule(Callable<V> callable, Duration delay)
schedule(Callable, long, TimeUnit).ListenableScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit)
java.util.concurrent.ScheduledExecutorServiceinitialDelay then initialDelay+period, then
initialDelay + 2 * period, and so on.
If any execution of the task
encounters an exception, subsequent executions are suppressed.
Otherwise, the task will only terminate via cancellation or
termination of the executor. If any execution of this task
takes longer than its period, then subsequent executions
may start late, but will not concurrently execute.scheduleAtFixedRate 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 parametersget() method will throw an
exception upon cancellationdefault ListenableScheduledFuture<?> scheduleAtFixedRate(Runnable command, Duration initialDelay, Duration period)
scheduleAtFixedRate(Runnable, long, long, TimeUnit).ListenableScheduledFuture<?> 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 parametersget() method will throw an
exception upon cancellationdefault ListenableScheduledFuture<?> scheduleWithFixedDelay(Runnable command, Duration initialDelay, Duration delay)
scheduleWithFixedDelay(Runnable, long, long, TimeUnit).Copyright © 2010–2020. All rights reserved.