public class CloseableScheduledExecutorService extends CloseableExecutorService
CloseableExecutorService.InternalFutureTask<T>, CloseableExecutorService.InternalScheduledFutureTaskisOpen| Constructor | Description |
|---|---|
CloseableScheduledExecutorService(java.util.concurrent.ScheduledExecutorService scheduledExecutorService) |
|
CloseableScheduledExecutorService(java.util.concurrent.ScheduledExecutorService scheduledExecutorService,
boolean shutdownOnClose) |
| Modifier and Type | Method | Description |
|---|---|---|
java.util.concurrent.Future<?> |
schedule(java.lang.Runnable task,
long delay,
java.util.concurrent.TimeUnit unit) |
Creates and executes a one-shot action that becomes enabled
after the given delay.
|
java.util.concurrent.Future<?> |
scheduleWithFixedDelay(java.lang.Runnable task,
long initialDelay,
long delay,
java.util.concurrent.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.
|
close, isShutdown, submit, submitpublic CloseableScheduledExecutorService(java.util.concurrent.ScheduledExecutorService scheduledExecutorService)
scheduledExecutorService - the service to decoratepublic CloseableScheduledExecutorService(java.util.concurrent.ScheduledExecutorService scheduledExecutorService,
boolean shutdownOnClose)
scheduledExecutorService - the service to decorateshutdownOnClose - if true, shutdown the executor service when this is closedpublic java.util.concurrent.Future<?> schedule(java.lang.Runnable task,
long delay,
java.util.concurrent.TimeUnit unit)
task - the task to executedelay - the time from now to delay executionunit - the time unit of the delay parameterpublic java.util.concurrent.Future<?> scheduleWithFixedDelay(java.lang.Runnable task,
long initialDelay,
long delay,
java.util.concurrent.TimeUnit unit)
task - 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 © 2011–2018 The Apache Software Foundation. All rights reserved.