|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
net.kwfgrid.gwes.GenericWorkflowHandler
public abstract class GenericWorkflowHandler
A GenericWorkflowHandler controls one workflow. This generic workflow handler is abstract and should be extended in order to implement a concrete one, which is specific to a certain Workflow Description Language. In order to implement your own GenericWorkflowHandler, you should override the methods
initiateWorkflow() startWorkflow() suspendWorkflow() resumeWorkflow() abortWorkflow()One concrete implemenation of the GenericWorkflowHandler is the KWfGenericWorkflowHandler.
GWorkflowDLHandler,
initiateWorkflow(),
startWorkflow(),
suspendWorkflow(),
resumeWorkflow(),
abortWorkflow()| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary |
|---|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
protected |
GenericWorkflowHandler(GWESEngine engine,
String originalWorkflowDescriptionType,
String workflowDescription,
String userID)
Constructor for GenericWorkflowHandler. |
| Method Summary | |
|---|---|
abstract void |
abortWorkflow()
Abort this workflow. |
abstract void |
abortWorkflowAsync()
Abort this workflow asynchonously. |
String |
createNewErrorID()
Get a new unique error ID for this workflow. |
ActivityTable |
getActivityTable()
Get the activity table with all activities triggered by this workflow instance. |
long |
getBirthday()
Get the birthday of this workflow. |
int |
getCompletedActivities()
|
abstract String[] |
getData(String placeID)
Get specific data that is hold inside the workflow and that is referenced by a data place identifier. |
abstract String |
getDescription()
Get the human-readable description of the workflow. |
long |
getDurationActive()
Get the duration of how long this workflow was "ACTIVE". |
long |
getDurationInitiated()
Get the duration of how long this workflow was "INITIATED" (before running). |
long |
getDurationRunning()
Get the duration of how long this workflow was "RUNNING" not including the time it was "ACTIVE". |
long |
getDurationSuspended()
Get the duration of how long this workflow was "SUSPENDED". |
long |
getDurationTotal()
Get the total workflow duration. |
long |
getDurationUndefined()
Get the duration of how long this workflow was "UNDEFINED" (before initiated). |
long |
getEndTime()
Get the completion or termination time of this workflow. |
GWESEngine |
getEngine()
Get the parent GWESEngine that owns this workflow handler. |
GWESLogger |
getGlog()
|
String |
getID()
Get the identifier of this workflow instance. |
protected String |
getNewActivityID()
Generate a new activity identifier. |
String |
getOriginalWorkflowDescriptionType()
Get the original workflow description type before conversion to default description type. |
int |
getStatus()
Get the current status code of this workflow as int. |
String |
getStatusAsString()
Get the current status of this workflow instance as string. |
int |
getTerminatedActivities()
|
String |
getUserID()
Get the user identifier of the owner of this workflow instance. |
Object |
getWorkflow()
|
String |
getWorkflowDescription()
Get the current workflow description of this workflow. |
String[] |
getWorkflowStatus()
Get the workflow status as an array of strings. |
void |
incrementCompletedActivities(int completedActivities)
|
void |
incrementTerminatedActivities(int terminatedActivities)
|
abstract void |
initiateWorkflow()
Initiate this workflow. |
protected void |
logStatistics()
|
protected String |
newID()
Creates a new Universal Unique ID for a workflow instance. |
abstract void |
resumeWorkflow()
Resume this workflow. |
abstract void |
run()
Implement this method for each Class that exends GridJob. |
abstract void |
setDescription(String description)
Set the human-readable description of the workflow. |
protected void |
setStatus(int status)
Set status of the workflow and notify threads that wait for a status change. |
void |
setWorkflowDescription(String workflowDescription)
Set the current workflow description of this workflow. |
abstract void |
startWorkflow()
Start this workflow. |
abstract String |
storeWorkflow()
Stores this workflow. |
abstract void |
suspendWorkflow()
Suspend this workflow. |
abstract void |
suspendWorkflowAsync()
Suspend this workflow asynchonously. |
int |
waitForStatusChangeFrom(int oldStatus)
Wait for workflow to change its status. |
void |
waitForStatusChangeTo(int newStatus)
Wait for workflow to change its status to a specified status. |
int |
waitForStatusChangeToCompletedOrTerminated()
Wait for workflow to change its status to final states COMPLETED or TERMINATED. |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected GenericWorkflowHandler(GWESEngine engine,
String originalWorkflowDescriptionType,
String workflowDescription,
String userID)
throws WorkflowSecurityException,
LoggingException
engine - The parent workflow handleroriginalWorkflowDescriptionType - The original type of workflow description, e.g. "GWorkflowDL 2.0" before conversion to default type.
WorkflowSecurityException
LoggingException| Method Detail |
|---|
public String getID()
public String getUserID()
public GWESLogger getGlog()
public String getOriginalWorkflowDescriptionType()
public String getWorkflowDescription()
public Object getWorkflow()
public void setWorkflowDescription(String workflowDescription)
throws net.kwfgrid.gworkflowdl.structure.WorkflowFormatException,
StateTransitionException
workflowDescription - The workflow description
net.kwfgrid.gworkflowdl.structure.WorkflowFormatException
StateTransitionExceptionprotected void setStatus(int status)
WorkflowStatus.STATUS_UNDEFINED,
WorkflowStatus.STATUS_INITIATED,
WorkflowStatus.STATUS_RUNNING,
WorkflowStatus.STATUS_SUSPENDED,
WorkflowStatus.STATUS_ACTIVE,
WorkflowStatus.STATUS_TERMINATED,
WorkflowStatus.STATUS_COMPLETED,
waitForStatusChangeTo(int),
waitForStatusChangeFrom(int)public int getStatus()
getStatusAsString(),
WorkflowStatus.STATUS_UNDEFINED,
WorkflowStatus.STATUS_INITIATED,
WorkflowStatus.STATUS_RUNNING,
WorkflowStatus.STATUS_SUSPENDED,
WorkflowStatus.STATUS_ACTIVE,
WorkflowStatus.STATUS_TERMINATED,
WorkflowStatus.STATUS_COMPLETED
public int waitForStatusChangeFrom(int oldStatus)
throws InterruptedException
oldStatus - The old status
InterruptedException - If the thread has been interrupted
public void waitForStatusChangeTo(int newStatus)
throws InterruptedException
newStatus - The new status code to wait for
InterruptedException - If the thread has been interrupted
public int waitForStatusChangeToCompletedOrTerminated()
throws InterruptedException
InterruptedException - If the thread has been interruptedpublic String getStatusAsString()
getStatus(),
WorkflowStatus.getStatusAsString(int)public String[] getWorkflowStatus()
"ID=hoheisel_f2968050-1d6a-11db-bacc-ad353bc1f9b1" "status=COMPLETED" "birthdayMs=1154003111126" "durationUndefinedMs=527" "durationInitiatedMs=792" "durationRunningMs=0" "durationActiveMs=0" "durationSuspendedMs=0" "durationTotalMs=1351" "endTimeMs=1154003112477" "level=MEMORY" "description=test workflow" "userID=test user"
public GWESEngine getEngine()
public ActivityTable getActivityTable()
protected String newID()
protected String getNewActivityID()
public long getDurationUndefined()
public long getDurationInitiated()
public long getDurationRunning()
public long getDurationActive()
public long getDurationSuspended()
public long getDurationTotal()
public long getBirthday()
public long getEndTime()
public String createNewErrorID()
protected void logStatistics()
public int getTerminatedActivities()
public void incrementTerminatedActivities(int terminatedActivities)
public int getCompletedActivities()
public void incrementCompletedActivities(int completedActivities)
public abstract void initiateWorkflow()
throws net.kwfgrid.gworkflowdl.structure.WorkflowFormatException,
StateTransitionException
net.kwfgrid.gworkflowdl.structure.WorkflowFormatException
StateTransitionException
public abstract void startWorkflow()
throws StateTransitionException
StateTransitionException
public abstract void suspendWorkflow()
throws StateTransitionException
StateTransitionException
public abstract void suspendWorkflowAsync()
throws StateTransitionException
StateTransitionException
public abstract void resumeWorkflow()
throws StateTransitionException
StateTransitionException
public abstract void abortWorkflow()
throws StateTransitionException
StateTransitionException
public abstract void abortWorkflowAsync()
throws StateTransitionException
StateTransitionException
public abstract String storeWorkflow()
throws DatabaseException
DatabaseExceptionpublic abstract String[] getData(String placeID)
placeID - The place identifier that refers to the data
public abstract String getDescription()
public abstract void setDescription(String description)
description - The description.public abstract void run()
run in interface Runnablerun in class Thread
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||