org.apache.oodt.cas.workflow.engine
Class IterativeWorkflowProcessorThread

java.lang.Object
  extended by org.apache.oodt.cas.workflow.engine.IterativeWorkflowProcessorThread
All Implemented Interfaces:
Runnable, WorkflowProcessorThread, CoreMetKeys, WorkflowStatus

public class IterativeWorkflowProcessorThread
extends Object
implements WorkflowProcessorThread, WorkflowStatus, CoreMetKeys

Version:
$Revision$

An instance of the WorkflowProcessorThread that processes through an iterative WorkflowInstance. This class keeps an Iterator that allows it to move from one end of a sequential Workflow processing pipeline to another. This class should only be used to process science pipeline style Workflows, i.e., those which resemble an iterative processing pipelines, with no forks, or concurrent task executions.

Author:
mattmann

Field Summary
 
Fields inherited from interface org.apache.oodt.cas.workflow.structs.WorkflowStatus
CREATED, ERROR, FINISHED, METADATA_MISSING, PAUSED, QUEUED, RESMGR_SUBMIT, STARTED
 
Fields inherited from interface org.apache.oodt.cas.workflow.metadata.CoreMetKeys
JOB_ID, PROCESSING_NODE, QUEUE_NAME, TASK_ID, WORKFLOW_INST_ID, WORKFLOW_MANAGER_URL
 
Constructor Summary
IterativeWorkflowProcessorThread(WorkflowInstance wInst, WorkflowInstanceRepository instRep, URL wParentUrl)
           
 
Method Summary
 String getCurrentTaskId()
           
 WorkflowInstanceRepository getInstanceRepository()
           
 org.apache.oodt.cas.resource.system.XmlRpcResourceManagerClient getRClient()
           
 long getWaitforConditionSatisfy()
           
 URL getWmgrParentUrl()
           
 WorkflowInstance getWorkflowInstance()
           
 boolean isPaused()
           
 boolean isStopped()
           
 void pause()
           Pauses exectuion of a WorkflowInstace being handled by this WorkflowProcessorThread.
 void resume()
           Resumes execution of a WorkflowProcessorThread.pause()d WorkflowInstace by this WorkflowProcessorThread.
 void run()
           
 void setInstanceRepository(WorkflowInstanceRepository instRep)
           
 void setRClient(org.apache.oodt.cas.resource.system.XmlRpcResourceManagerClient client)
           
 void setWaitforConditionSatisfy(long waitforConditionSatisfy)
           
 void setWmgrParentUrl(URL wmgrParentUrl)
           
 void setWorkflowInst(WorkflowInstance workflowInst)
           
 void stop()
           Stops once and for all the thread from processing the workflow.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IterativeWorkflowProcessorThread

public IterativeWorkflowProcessorThread(WorkflowInstance wInst,
                                        WorkflowInstanceRepository instRep,
                                        URL wParentUrl)
Method Detail

run

public void run()
Specified by:
run in interface Runnable

getWorkflowInstance

public WorkflowInstance getWorkflowInstance()
Specified by:
getWorkflowInstance in interface WorkflowProcessorThread
Returns:
The WorkflowInstance that this Thread is processing.

stop

public void stop()
Description copied from interface: WorkflowProcessorThread

Stops once and for all the thread from processing the workflow. This method should not maintain the state of the workflow, it should gracefully shut down the WorkflowProcessorThread and any of its subsequent resources.

Specified by:
stop in interface WorkflowProcessorThread

resume

public void resume()
Description copied from interface: WorkflowProcessorThread

Resumes execution of a WorkflowProcessorThread.pause()d WorkflowInstace by this WorkflowProcessorThread.

Specified by:
resume in interface WorkflowProcessorThread

pause

public void pause()
Description copied from interface: WorkflowProcessorThread

Pauses exectuion of a WorkflowInstace being handled by this WorkflowProcessorThread.

Specified by:
pause in interface WorkflowProcessorThread

isPaused

public boolean isPaused()
Returns:
True if the WorkflowInstance managed by this processor is paused.

isStopped

public boolean isStopped()

getCurrentTaskId

public String getCurrentTaskId()
Returns:
Returns the fCurrentTaskId.

setWorkflowInst

public void setWorkflowInst(WorkflowInstance workflowInst)
Parameters:
workflowInst - The fWorkflowInst to set.

getWaitforConditionSatisfy

public long getWaitforConditionSatisfy()
Returns:
Returns the waitForConditionSatisfy.

setWaitforConditionSatisfy

public void setWaitforConditionSatisfy(long waitforConditionSatisfy)
Parameters:
waitforConditionSatisfy - The waitForConditionSatisfy to set.

getInstanceRepository

public WorkflowInstanceRepository getInstanceRepository()
Returns:
the instRep

setInstanceRepository

public void setInstanceRepository(WorkflowInstanceRepository instRep)
Parameters:
instRep - the instRep to set

getRClient

public org.apache.oodt.cas.resource.system.XmlRpcResourceManagerClient getRClient()
Returns:
the rClient

setRClient

public void setRClient(org.apache.oodt.cas.resource.system.XmlRpcResourceManagerClient client)
Parameters:
client - the rClient to set

getWmgrParentUrl

public URL getWmgrParentUrl()
Returns:
the wmgrParentUrl

setWmgrParentUrl

public void setWmgrParentUrl(URL wmgrParentUrl)
Parameters:
wmgrParentUrl - the wmgrParentUrl to set


Copyright © 1999-2011 Apache OODT. All Rights Reserved.