|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.openprivacy.reptile.tasks.TaskManager
Generic interface for running tasks in the background. These are basically just Threads.
Constructor Summary | |
TaskManager()
|
Method Summary | |
boolean |
anyTasksRunning()
Return true if ANY tasks are currently running. |
static boolean |
checkTaskSystemDisabled()
If the Task system is enabled, return true. |
boolean |
contains(java.lang.String identifier)
Return true if this Task manager contains the given task. |
void |
destroy()
Destroy the tasks system. |
static TaskManager |
getInstance()
Get an instance of the TaskManager . |
Task |
getTask(java.lang.String identifier)
Get a task from the TaskManager. |
int |
getTaskCount()
Return the total number of tasks. |
java.util.Enumeration |
getTasks()
Get all known tasks. |
void |
register(java.lang.Class clazz)
Start a specific task. |
void |
register(Task task)
Register the given task for further processing. |
static void |
runTask(Task task)
Run a specific task, catching all exceptions and logging them correctly. |
void |
unregister(java.lang.String identifier)
Unregister the given task so that it doesn't process any more. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TaskManager()
Method Detail |
public static TaskManager getInstance()
TaskManager
.
public boolean contains(java.lang.String identifier)
public java.util.Enumeration getTasks()
public void register(java.lang.Class clazz) throws java.lang.Exception
java.lang.Exception
public void register(Task task) throws java.lang.Exception
java.lang.Exception
public void unregister(java.lang.String identifier) throws java.lang.Exception
java.lang.Exception
public static boolean checkTaskSystemDisabled()
public Task getTask(java.lang.String identifier) throws java.lang.Exception
java.lang.Exception
public int getTaskCount()
public boolean anyTasksRunning()
public void destroy()
public static void runTask(Task task)
This is the best way to run a task. Do not call run() directly.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |