org.omegahat.Environment.TaskManagement
Class TaskManager
java.lang.Object
|
+--org.omegahat.Environment.TaskManagement.TaskManager
- All Implemented Interfaces:
- DistributedTaskConstants, java.lang.Runnable
- Direct Known Subclasses:
- BackgroundTaskManager, DistributedTaskManager, SimulationManager
- public class TaskManager
- extends java.lang.Object
- implements java.lang.Runnable, DistributedTaskConstants
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
debug
public boolean debug
tasks
protected TaskQueue tasks
listeners
protected java.util.Vector listeners
TaskManager
public TaskManager()
TaskManager
public TaskManager(int size)
TaskManager
public TaskManager(int size,
boolean debug)
TaskManager
public TaskManager(TaskQueue q)
TaskManager
public TaskManager(TaskQueue q,
boolean debug)
createQueue
public TaskQueue createQueue(int size)
run
public void run()
- Specified by:
run in interface java.lang.Runnable
warn
public boolean warn(Task t,
java.lang.Exception ex)
getTask
public Task getTask(boolean block)
- get the next task, optionally blocking to wait for a task if none is
currently available.
Well, in principle, but currently this method ignores its argument and
always blocks. A subclass could provide non-blocking task access.
getTask
public Task getTask()
- Get the next task, removing it from the queue. If no task is currently available,
wait until one is.
isComplete
public boolean isComplete()
dispatchTask
public java.lang.Object dispatchTask(Task t)
addTask
public int addTask(Task t)
notify
public boolean notify(Task task,
java.lang.Object server,
int type)
notify
public boolean notify(DistributedTaskEvent ev)
notify
public boolean notify(DistributedTaskEvent ev,
int type)
addListener
public int addListener(DistributedTaskListener l)
removeListener
public boolean removeListener(DistributedTaskListener l)
tasks
public TaskQueue tasks()
tasks
public TaskQueue tasks(TaskQueue t)
listeners
public java.util.Vector listeners()
listeners
public java.util.Vector listeners(java.util.Vector v)