|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.oodt.cas.workflow.engine.ThreadPoolWorkflowEngine
public class ThreadPoolWorkflowEngine
The ThreadPooling portion of the WorkflowEngine. This class is meant to be an extension point for WorkflowEngines that want to implement ThreadPooling. This WorkflowEngine provides everything needed to manage a ThreadPool using Doug Lea's wonderful java.util.concurrent package that made it into JDK5.
Field Summary |
---|
Fields inherited from interface org.apache.oodt.cas.workflow.engine.WorkflowEngine |
---|
X_POINT_ID |
Fields inherited from interface org.apache.oodt.cas.workflow.structs.WorkflowStatus |
---|
CREATED, ERROR, FINISHED, METADATA_MISSING, PAUSED, QUEUED, RESMGR_SUBMIT, STARTED |
Constructor Summary | |
---|---|
ThreadPoolWorkflowEngine(WorkflowInstanceRepository instRep,
int queueSize,
int maxPoolSize,
int minPoolSize,
long threadKeepAliveTime,
boolean unlimitedQueue,
URL resUrl)
Default Constructor. |
Method Summary | |
---|---|
double |
getCurrentTaskWallClockMinutes(String workflowInstId)
Gets the amount of wall clock minutes that the particular WorkflowTask within a WorkflowInstance has been executing
for. |
protected static double |
getCurrentTaskWallClockMinutes(WorkflowInstance inst)
|
WorkflowInstanceRepository |
getInstanceRepository()
Gets the WorkflowInstanceRepository used by this
WorkflowEngine . |
double |
getWallClockMinutes(String workflowInstId)
Gets the amount of wall clock minutes that a particular WorkflowInstance (identified by its workflowInst )
has been executing. |
protected static double |
getWallClockMinutes(WorkflowInstance inst)
|
org.apache.oodt.cas.metadata.Metadata |
getWorkflowInstanceMetadata(String workflowInstId)
Gets the Metadata associated with the WorkflowInstance
identified by the given identifier. |
void |
pauseWorkflowInstance(String workflowInstId)
Pauses the WorkflowInstance specified by its
workflowInstId . |
void |
resumeWorkflowInstance(String workflowInstId)
Resumes Execution of the specified WorkflowInstance identified by
its workflowInstId . |
void |
setWorkflowManagerUrl(URL url)
Sets a pointer to the Workflow Manager that this WorkflowEngine
belongs to. |
WorkflowInstance |
startWorkflow(Workflow workflow,
org.apache.oodt.cas.metadata.Metadata metadata)
Starts the specified Workflow by creating a
WorkflowInstance , and then running that instance. |
void |
stopWorkflow(String workflowInstId)
Stops the WorkflowInstance identified by the given
workflowInstId . |
boolean |
updateMetadata(String workflowInstId,
org.apache.oodt.cas.metadata.Metadata met)
Updates the Metadata context for the WorkflowInstance
identified by the given workflowInstId |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ThreadPoolWorkflowEngine(WorkflowInstanceRepository instRep, int queueSize, int maxPoolSize, int minPoolSize, long threadKeepAliveTime, boolean unlimitedQueue, URL resUrl)
instRep
- The WorkflowInstanceRepository to be used by this engine.queueSize
- The size of the queue that the workflow engine should use
(irrelevant if unlimitedQueue is set to true)maxPoolSize
- The minimum thread pool size.minPoolSize
- The maximum thread pool size.threadKeepAliveTime
- The amount of minutes that each thread in the pool should be
kept alive.unlimitedQueue
- Whether or not to use a queue whose bounds are dictated by the
physical memory of the underlying hardware.resUrl
- A URL pointer to a resource manager. If this is set Tasks will
be wrapped as Resource Manager Job
s and sent through
the Resource Manager. If this parameter is not set, local
execution (the default) will be usedMethod Detail |
---|
public void pauseWorkflowInstance(String workflowInstId)
WorkflowEngine
Pauses the WorkflowInstance
specified by its
workflowInstId
.
pauseWorkflowInstance
in interface WorkflowEngine
workflowInstId
- The ID of the Workflow Instance to pause.public void resumeWorkflowInstance(String workflowInstId)
WorkflowEngine
Resumes Execution of the specified WorkflowInstance
identified by
its workflowInstId
.
resumeWorkflowInstance
in interface WorkflowEngine
workflowInstId
- The ID of the WorkflowInstance
to resume.public WorkflowInstance startWorkflow(Workflow workflow, org.apache.oodt.cas.metadata.Metadata metadata) throws EngineException
WorkflowEngine
Starts the specified Workflow
by creating a
WorkflowInstance
, and then running that instance. The started
WorkflowInstance
which is returned, will have its status updated
by the workflow engine, including its status field, and its
currentTaskId.
startWorkflow
in interface WorkflowEngine
workflow
- The abstract representation of the Workflow
to start.metadata
- Any metadata that needs to be shared between the tasks in the
WorkflowInstance
.
WorkflowInstance
which can be used to monitor the
execution of the Workflow
through the Engine.
EngineException
- If any error occurs.public WorkflowInstanceRepository getInstanceRepository()
WorkflowEngine
WorkflowInstanceRepository
used by this
WorkflowEngine
.
getInstanceRepository
in interface WorkflowEngine
WorkflowInstanceRepository
used by this
WorkflowEngine
.public boolean updateMetadata(String workflowInstId, org.apache.oodt.cas.metadata.Metadata met)
WorkflowEngine
Metadata
context for the WorkflowInstance
identified by the given workflowInstId
updateMetadata
in interface WorkflowEngine
workflowInstId
- Identifies the WorkflowInstance
whose Metadata
context will be updated.met
- The new Metadata
context.
public void setWorkflowManagerUrl(URL url)
WorkflowEngine
WorkflowEngine
belongs to.
setWorkflowManagerUrl
in interface WorkflowEngine
url
- The URL
pointer to the Workflow Manager that this
WorkflowEngine
belongs to.public void stopWorkflow(String workflowInstId)
WorkflowEngine
WorkflowInstance
identified by the given
workflowInstId
.
stopWorkflow
in interface WorkflowEngine
workflowInstId
- The identifier of the WorkflowInstance
to stop.public double getCurrentTaskWallClockMinutes(String workflowInstId)
WorkflowEngine
WorkflowTask
within a WorkflowInstance
has been executing
for.
getCurrentTaskWallClockMinutes
in interface WorkflowEngine
workflowInstId
- The identifier of the WorkflowInstance
to measure wall
clock time for its current WorkflowTask
.
WorkflowInstance
's current WorkflowTask
has been
executing for.public org.apache.oodt.cas.metadata.Metadata getWorkflowInstanceMetadata(String workflowInstId)
WorkflowEngine
Metadata
associated with the WorkflowInstance
identified by the given identifier.
getWorkflowInstanceMetadata
in interface WorkflowEngine
workflowInstId
- The identifier of the WorkflowInstance
to obtain the
Metadata
for.
Metadata
shared context of the
WorkflowInstance
with the given identifier.public double getWallClockMinutes(String workflowInstId)
WorkflowEngine
WorkflowInstance
(identified by its workflowInst
)
has been executing. This includes time spent QUEUED
, time
spent WAITING
, throughout its entire lifecycle.
getWallClockMinutes
in interface WorkflowEngine
workflowInstId
- The identifier of the WorkflowInstance
to measure wall
clock time for.
WorkflowInstance
has been executing for.protected static double getWallClockMinutes(WorkflowInstance inst)
protected static double getCurrentTaskWallClockMinutes(WorkflowInstance inst)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |