java.lang.Object
org.gjt.sp.util.TaskManager
The TaskManager manage Tasks in the Threadpool, it knows all of them, and
sends events to TaskListeners.
- Author:
- Matthieu Casanova
-
Nested Class Summary
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addTaskListener
(TaskListener listener) void
cancelTasksByClass
(Class<? extends Task> clazz) cancel a task by its classint
Return the number of IO tasks in queue.int
Return the number of tasks in queue.void
removeTaskListener
(TaskListener listener) void
visit
(TaskManager.TaskVisitor visitor) Visit all tasks.void
Wait for all IO tasks to finish
-
Field Details
-
instance
A singleton instance of TaskManager
-
-
Method Details
-
countTasks
public int countTasks()Return the number of tasks in queue.- Returns:
- the number of tasks in queue
- Since:
- jEdit 4.5pre1
-
countIoTasks
public int countIoTasks()Return the number of IO tasks in queue.- Returns:
- the number of IO tasks in queue
- Since:
- jEdit 5.1pre1
-
addTaskListener
-
removeTaskListener
-
visit
Visit all tasks. While doing this the task list is locked- Parameters:
visitor
- the visitor
-
waitForIoTasks
public void waitForIoTasks()Wait for all IO tasks to finish- Since:
- jEdit 5.1pre1
-
cancelTasksByClass
cancel a task by its class- Since:
- jEdit 5.1pre1
-