java.util.concurrent
Class Executors.DelegatedScheduledExecutorService
java.lang.Object
java.util.concurrent.AbstractExecutorService
java.util.concurrent.Executors.DelegatedExecutorService
java.util.concurrent.Executors.DelegatedScheduledExecutorService
- All Implemented Interfaces:
- Executor, ExecutorService, ScheduledExecutorService
- Enclosing class:
- Executors
static class Executors.DelegatedScheduledExecutorService
- extends Executors.DelegatedExecutorService
- implements ScheduledExecutorService
A wrapper class that exposes only the ExecutorService and
ScheduleExecutor methods of a ScheduledExecutorService implementation.
|
Method Summary |
|
schedule(Callable<V> callable,
long delay,
TimeUnit unit)
Creates and executes a ScheduledFuture that becomes enabled after the
given delay. |
ScheduledFuture<?> |
schedule(Runnable command,
long delay,
TimeUnit unit)
Creates and executes a one-shot action that becomes enabled
after the given delay. |
ScheduledFuture<?> |
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. |
ScheduledFuture<?> |
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. |
| Methods inherited from class java.util.concurrent.Executors.DelegatedExecutorService |
awaitTermination, execute, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNow, submit, submit, submit |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.concurrent.ExecutorService |
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNow, submit, submit, submit |
Executors.DelegatedScheduledExecutorService
Executors.DelegatedScheduledExecutorService(ScheduledExecutorService executor)
schedule
public ScheduledFuture<?> schedule(Runnable command,
long delay,
TimeUnit unit)
- Description copied from interface:
ScheduledExecutorService
- Creates and executes a one-shot action that becomes enabled
after the given delay.
- Specified by:
schedule in interface ScheduledExecutorService
- Parameters:
command - the task to execute.delay - the time from now to delay execution.unit - the time unit of the delay parameter.
- Returns:
- a Future representing pending completion of the task,
and whose get() method will return null
upon completion.
schedule
public <V> ScheduledFuture<V> schedule(Callable<V> callable,
long delay,
TimeUnit unit)
- Description copied from interface:
ScheduledExecutorService
- Creates and executes a ScheduledFuture that becomes enabled after the
given delay.
- Specified by:
schedule in interface ScheduledExecutorService
- Parameters:
callable - the function to execute.delay - the time from now to delay execution.unit - the time unit of the delay parameter.
- Returns:
- a ScheduledFuture that can be used to extract result or cancel.
scheduleAtFixedRate
public ScheduledFuture<?> scheduleAtFixedRate(Runnable command,
long initialDelay,
long period,
TimeUnit unit)
- Description copied from interface:
ScheduledExecutorService
- 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.
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.
- Specified by:
scheduleAtFixedRate in interface ScheduledExecutorService
- Parameters:
command - the task to execute.initialDelay - the time to delay first execution.period - the period between successive executions.unit - the time unit of the initialDelay and period parameters
- Returns:
- a Future representing pending completion of the task,
and whose get() method will throw an exception upon
cancellation.
scheduleWithFixedDelay
public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command,
long initialDelay,
long delay,
TimeUnit unit)
- Description copied from interface:
ScheduledExecutorService
- 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. 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.
- Specified by:
scheduleWithFixedDelay in interface ScheduledExecutorService
- Parameters:
command - the task to execute.initialDelay - the time to delay first execution.delay - the delay between the termination of one
execution and the commencement of the next.unit - the time unit of the initialDelay and delay parameters
- Returns:
- a Future representing pending completion of the task,
and whose get() method will throw an exception upon
cancellation.
Please submit a feedback, bug or feature