org.openprivacy.reptile.tasks
Class TaskManager

java.lang.Object
  |
  +--org.openprivacy.reptile.tasks.TaskManager

public class TaskManager
extends java.lang.Object

Generic interface for running tasks in the background. These are basically just Threads.

Version:
$Id: TaskManager.java,v 1.5 2001/12/12 09:29:07 burton Exp $
Author:
burtonator

Constructor Summary
TaskManager()
           
 
Method Summary
static boolean checkTaskSystemEnabled()
          If the Task system is enabled, return true.
 boolean contains(java.lang.String identifier)
          Return true if this Task manager contains the given task.
static TaskManager getInstance()
          Get an instance of the TaskManager.
 Task getTask(java.lang.String identifier)
          Get a task from the TaskManager.
 java.util.Enumeration getTasks()
          Get all known tasks.
 void run(java.lang.String type)
          Run all tasks with the given type.
 void run(Task task)
          Run this given task.
 void start(java.lang.Class clazz)
          Start a specific task.
 void start(Task task)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaskManager

public TaskManager()
Method Detail

getInstance

public static TaskManager getInstance()
Get an instance of the TaskManager.

contains

public boolean contains(java.lang.String identifier)
Return true if this Task manager contains the given task.

getTasks

public java.util.Enumeration getTasks()
Get all known tasks.

start

public void start(java.lang.Class clazz)
           throws java.lang.Exception
Start a specific task.

start

public void start(Task task)
           throws java.lang.Exception

run

public void run(Task task)
         throws java.lang.Exception
Run this given task. This can only happen if it's state is PAUSED.

checkTaskSystemEnabled

public static boolean checkTaskSystemEnabled()
                                      throws java.lang.Exception
If the Task system is enabled, return true.

run

public void run(java.lang.String type)
         throws java.lang.Exception
Run all tasks with the given type.

getTask

public Task getTask(java.lang.String identifier)
             throws java.lang.Exception
Get a task from the TaskManager.