| Modifier and Type | Class and Description |
|---|---|
static class |
TaskScheduler.Task<T> |
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
cancelMayInterruptIfRunning |
protected ScheduledExecutorService |
executor |
protected AtomicReference<ScheduledFuture<?>> |
taskRef |
| Constructor and Description |
|---|
TaskScheduler() |
TaskScheduler(boolean cancelMayInterruptIfRunning) |
TaskScheduler(boolean cancelMayInterruptIfRunning,
ScheduledExecutorService executor) |
TaskScheduler(boolean cancelMayInterruptIfRunning,
ThreadFactory threadFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel() |
boolean |
hasTask() |
void |
scheduleAtFixedRate(TaskScheduler.Task<T> task,
long initialDelay,
long period,
TimeUnit unit) |
void |
scheduleWithFixedDelay(TaskScheduler.Task<T> task,
long initialDelay,
long delay,
TimeUnit unit) |
void |
shutdownNow() |
protected final boolean cancelMayInterruptIfRunning
protected final ScheduledExecutorService executor
protected final AtomicReference<ScheduledFuture<?>> taskRef
public TaskScheduler()
public TaskScheduler(boolean cancelMayInterruptIfRunning)
public TaskScheduler(boolean cancelMayInterruptIfRunning,
ThreadFactory threadFactory)
public TaskScheduler(boolean cancelMayInterruptIfRunning,
ScheduledExecutorService executor)
public void scheduleAtFixedRate(TaskScheduler.Task<T> task, long initialDelay, long period, TimeUnit unit)
public void scheduleWithFixedDelay(TaskScheduler.Task<T> task, long initialDelay, long delay, TimeUnit unit)
public void cancel()
public void shutdownNow()
public boolean hasTask()
Copyright © 2017. All rights reserved.