HPSearch

cgl.hpsearch.engine
Class TaskHandler

java.lang.Object
  extended bycgl.hpsearch.engine.TaskHandler
All Implemented Interfaces:
SystemConstants

public class TaskHandler
extends Object
implements SystemConstants

Handles the initialization - completion of a flow on the active workflow engine

Author:
Harshawardhan S. Gadgil Date: Feb 2, 2004

Field Summary
 boolean started
           
 
Fields inherited from interface cgl.hpsearch.common.SystemConstants
ABANDON_HANDLER, ABANDONED, BROKER_HOST, BROKER_PORT, BUF_SIZE, EOT, EXCEPTION, FAILURE, FILESEPARTOR, FLOW_LOGGING_MANAGER, FLOW_MANAGER, HPSEARCH_CONFIG, HPSEARCH_HOME, HPSEARCH_SHELL, HPSEARCH_WS, MARKER, NB_HOME, NB_PERFORMANCE_DATA_TOPIC, OS_TYPE, OS_UNIX, OS_WIN, PORT, PROTOCOL, READY, RESUME, RUNNING, SCRIPT_ARGS, SCRIPT_PATH, SHELLWS_PORT, START_HANDLER, STREAM_MARKER_DATA, STREAM_MARKER_EOF, STX, SUCCESS, SUSPEND, TASK_DEFINED, TASK_SCHEDULER_ENGINE, TASKSCHEDULER_AUTO_CONNECT_COMM_LINK, TASKSCHEDULER_ENGINE_COMM_LINK, THREAD_SLEEP_INTERVAL, UNKNOWN, WAITING, WSCONTEXT_RESULT_BIN, WSCONTEXT_SERVICE
 
Constructor Summary
TaskHandler(Vector flowComponents, String engineid, String flowid, TaskSchedulerEngine _engine)
           
 
Method Summary
 String getHandlerID(String taskid)
          Gets the handlerID of the specified task
 int getStatus()
           
 void processHandlerEvent(String handlerId, HandlerEvent hEv)
          Sends ABANDON command to all Request Handlers belonging to this flow
 void registerTaskCompletion(String taskID, int taskCompletionStatus)
          Register the completion status of a particular task
 void registerTaskHandle(String taskid, String handlerID)
          Registers the requestHandler's handle with a particular task.
 void waitUntilFlowCompletes()
          Locks the executing thread until all flow components complete (i.e. the taskTable is empty)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

started

public boolean started
Constructor Detail

TaskHandler

public TaskHandler(Vector flowComponents,
                   String engineid,
                   String flowid,
                   TaskSchedulerEngine _engine)
Method Detail

processHandlerEvent

public void processHandlerEvent(String handlerId,
                                HandlerEvent hEv)
Sends ABANDON command to all Request Handlers belonging to this flow

Parameters:
handlerId -
hEv -

registerTaskHandle

public void registerTaskHandle(String taskid,
                               String handlerID)
Registers the requestHandler's handle with a particular task. Also automatically starts the flow when all tasks have been assigned.

Parameters:
taskid -
handlerID -

registerTaskCompletion

public void registerTaskCompletion(String taskID,
                                   int taskCompletionStatus)
Register the completion status of a particular task

Parameters:
taskID - The ID of the task
taskCompletionStatus - the completion status of the task referred by 'taskID'

waitUntilFlowCompletes

public void waitUntilFlowCompletes()
Locks the executing thread until all flow components complete (i.e. the taskTable is empty)


getHandlerID

public String getHandlerID(String taskid)
Gets the handlerID of the specified task

Parameters:
taskid - - The task
Returns:
the handlerID, null if the task does not exist or a handlerID has not yet been assigned

getStatus

public int getStatus()

HPSearch

For comments and suggestions please send e-mail to Harshawardhan Gadgil
Last updated: June 9 2006