public class ReschedulableTask extends Object
ScheduledExecutorService| Constructor and Description |
|---|
ReschedulableTask(ScheduledExecutorService executor,
Runnable command) |
| Modifier and Type | Method and Description |
|---|---|
void |
reschedule(long delay,
TimeUnit unit)
Re-schedule the given task so that it get invoked only once.
|
void |
scheduleOnce(long delay,
TimeUnit unit)
Schedule the execution of the command only once.
|
public ReschedulableTask(ScheduledExecutorService executor, Runnable command)
public void reschedule(long delay,
TimeUnit unit)
delay - the time from now to delay executionunit - the time unit of the delay parameterpublic void scheduleOnce(long delay,
TimeUnit unit)
delay - the time from now to delay executionunit - the time unit of the delay parameterCopyright © 2015. All rights reserved.