| Modifier and Type | Class | Description |
|---|---|---|
static class |
TaskScheduler.Task<T> |
| Modifier and Type | Field | Description |
|---|---|---|
protected boolean |
cancelMayInterruptIfRunning |
|
protected ScheduledExecutorService |
executor |
|
protected AtomicReference<ScheduledFuture<?>> |
taskRef |
| Constructor | Description |
|---|---|
TaskScheduler() |
|
TaskScheduler(boolean cancelMayInterruptIfRunning) |
|
TaskScheduler(boolean cancelMayInterruptIfRunning,
ScheduledExecutorService executor) |
|
TaskScheduler(boolean cancelMayInterruptIfRunning,
ThreadFactory threadFactory) |
| Modifier and Type | Method | 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 © 2018. All rights reserved.