HPSearch

cgl.hpsearch.engine.handlers
Class WSProxyHandler

java.lang.Object
  extended bycgl.hpsearch.engine.handlers.Handler
      extended bycgl.hpsearch.engine.handlers.WSProxyHandler
All Implemented Interfaces:
EndPointListener, Runnable, SystemConstants

public class WSProxyHandler
extends Handler
implements SystemConstants, EndPointListener

Handles a WSProxy and manages all the communication, error-handling etc.. with the WSProxy
Created on Apr 20, 2004

Author:
Harshawardhan Gadgil (hgadgil@grids.ucs.indiana.edu)

Field Summary
 
Fields inherited from class cgl.hpsearch.engine.handlers.Handler
parent
 
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
WSProxyHandler()
           
 
Method Summary
 void _Handler_Abandon()
          Abandons this handler in its current state !
 void _Handler_Init(String initParams)
           
 void _Handler_run()
           
 void eof(String msg)
           
 int executeAction(String actionToTake)
          Defines an action to be executed on the service.
 String getParameter(String propertyName)
          Returns the service status
 String[] getRegisteredExceptions()
          Returns the possible exceptions caught by the service.
 String getServiceStatus()
           
 int initService(String serviceClassName, String[] in, String[] out, Parameter[] params, ErrorAction[] errorMap)
          Calls the WSProxy's init and invoke functions to set up the service.
 void onEvent(String msg)
          Handles an event received on the Error processing stream.
 void setParameter(String name, String value)
          Sets / resets the parameter for the invoked service
If the parameter specified by the name was not specified during startup then its added in the services' table, else the previous value is replaced.
 
Methods inherited from class cgl.hpsearch.engine.handlers.Handler
abandon, finished, getMessage, getStatus, init, notifyController, run, setMessage, setRequestHandler, setStatus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WSProxyHandler

public WSProxyHandler()
Method Detail

_Handler_Init

public void _Handler_Init(String initParams)
Specified by:
_Handler_Init in class Handler

initService

public int initService(String serviceClassName,
                       String[] in,
                       String[] out,
                       Parameter[] params,
                       ErrorAction[] errorMap)
Calls the WSProxy's init and invoke functions to set up the service.

Parameters:
serviceClassName - - The RunnableProxyWebService to initialize
For example - cgl.hpsearch.services.sample.DoNothingService
in - - An array containing the i/p URIs the service must subscribe from
out - - An array containing the o/p URIs the service must publish to.
params - - Optional parameters that need to be passed to the service
errorMap - - A map of catchable exceptions
Returns:
A string representing the service Status.

_Handler_Abandon

public void _Handler_Abandon()
Abandons this handler in its current state !

Specified by:
_Handler_Abandon in class Handler

_Handler_run

public void _Handler_run()
Specified by:
_Handler_run in class Handler

getRegisteredExceptions

public String[] getRegisteredExceptions()
Returns the possible exceptions caught by the service. The Orchestration service can then look out for these errors and take the specified action.

Returns:
An array of Strings containing the possible catchable exceptions.

executeAction

public int executeAction(String actionToTake)
Defines an action to be executed on the service. Valid actions are

Parameters:
actionToTake -
Returns:
String containing the service status / error

setParameter

public void setParameter(String name,
                         String value)
Sets / resets the parameter for the invoked service
If the parameter specified by the name was not specified during startup then its added in the services' table, else the previous value is replaced.

Parameters:
name -
value -

getServiceStatus

public String getServiceStatus()
Returns:
The service status

getParameter

public String getParameter(String propertyName)
Returns the service status

Returns:
String containing the service status

eof

public void eof(String msg)
Specified by:
eof in interface EndPointListener

onEvent

public void onEvent(String msg)
Handles an event received on the Error processing stream.

Specified by:
onEvent in interface EndPointListener
Parameters:
msg - - The message to be processed

HPSearch

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