Package org.gjt.sp.util
Class TaskManager
- java.lang.Object
-
- org.gjt.sp.util.TaskManager
-
public class TaskManager extends java.lang.ObjectThe TaskManager manage Tasks in the Threadpool, it knows all of them, and sends events to TaskListeners.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceTaskManager.TaskVisitor
-
Field Summary
Fields Modifier and Type Field Description static TaskManagerinstanceA singleton instance of TaskManager
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTaskListener(TaskListener listener)voidcancelTasksByClass(java.lang.Class<? extends Task> clazz)cancel a task by its classintcountIoTasks()Return the number of IO tasks in queue.intcountTasks()Return the number of tasks in queue.voidremoveTaskListener(TaskListener listener)voidvisit(TaskManager.TaskVisitor visitor)Visit all tasks.voidwaitForIoTasks()Wait for all IO tasks to finish
-
-
-
Field Detail
-
instance
public static final TaskManager instance
A singleton instance of TaskManager
-
-
Method Detail
-
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
public void addTaskListener(TaskListener listener)
-
removeTaskListener
public void removeTaskListener(TaskListener listener)
-
visit
public void visit(TaskManager.TaskVisitor visitor)
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
public void cancelTasksByClass(java.lang.Class<? extends Task> clazz)
cancel a task by its class- Since:
- jEdit 5.1pre1
-
-