| Modifier and Type | Field and Description |
|---|---|
protected long |
schedulerTimeout |
| Constructor and Description |
|---|
TaskScheduler(ThreadPool threadPool)
Creates a
TaskScheduler that uses the supplied
ThreadPool to execute tasks. |
| Modifier and Type | Method and Description |
|---|---|
void |
addTask(SchedulerTask task)
Adds a task to the scheduler.
|
void |
clear()
Removes all tasks.
|
boolean |
isStop()
Checks if the scheduler is (to be) stopped.
|
boolean |
removeTask(SchedulerTask task)
Removes a task from the scheduler.
|
void |
run()
Runs the scheduler.
|
void |
setStop(boolean stop)
Stops the schedulers run method.
|
public TaskScheduler(ThreadPool threadPool)
TaskScheduler that uses the supplied
ThreadPool to execute tasks.threadPool - a ThreadPool.public void addTask(SchedulerTask task)
task - a SchedulerTask.public boolean removeTask(SchedulerTask task)
task - the SchedulerTask to be removed from the schedulertrue if the task could be removed.public void clear()
public void run()
public void setStop(boolean stop)
stop - true to stop the scheduler.public boolean isStop()
true if the scheduler has been stopped or is being stopped.Copyright © 2016 SNMP4J.org. All Rights Reserved.