edu.mssm.crover.ims.tasks.workers
Class AbstractWorker

java.lang.Object
  |
  +--edu.mssm.crover.ims.tasks.workers.AbstractWorker
Direct Known Subclasses:
DirectWorker, RMIWorker

public abstract class AbstractWorker
extends java.lang.Object

A worker executes tasks. The worker waits unless tasks are scheduled for execution. Workers compete to obtain tasks from a TaskManager. obtains tasks from the TaskManager. There should be no need extenting AbstractWorker outside of the task management package.

See Also:
RMIWorker, <{edu.mssm.crover.ims.tasks.workers.DirectWorker}>

Field Summary
protected  long pauseLength
           
 
Constructor Summary
protected AbstractWorker(java.lang.String[] st)
           
 
Method Summary
abstract  void activate()
           
 java.lang.String[] getSupportedTasks()
          Returns the type of tasks supported by this worker.
 void setPauseLength(long pause_length)
          Sets the pause length.
 void setSupportedTasks(java.lang.String[] st)
          Returns the kind of tasks supported by this worker.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pauseLength

protected long pauseLength
Constructor Detail

AbstractWorker

protected AbstractWorker(java.lang.String[] st)
Method Detail

setSupportedTasks

public void setSupportedTasks(java.lang.String[] st)
Returns the kind of tasks supported by this worker.

Returns:
An array of task fully specified class names.

getSupportedTasks

public java.lang.String[] getSupportedTasks()
Returns the type of tasks supported by this worker. Types of tasks are encoded as the classname of the TaskEngine which can execute the task.


activate

public abstract void activate()
                       throws java.rmi.RemoteException,
                              java.lang.ClassNotFoundException,
                              java.lang.InstantiationException,
                              java.lang.IllegalAccessException
java.rmi.RemoteException
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException

setPauseLength

public void setPauseLength(long pause_length)
Sets the pause length. Pause length is the amount of time that the worker waits (when no task has been obtained from the task manager), before it tries to get a task again.

Parameters:
pause_length - length of the pause, in milli seconds


Copyright @ 2003 Mount Sinai School of Medicine. All Rights Reserved.