Class TaskRunner
- java.lang.Object
-
- fr.ens.biologie.genomique.eoulsan.core.workflow.TaskRunner
-
public class TaskRunner extends Object
This class allow to run a task context.- Since:
- 2.0
- Author:
- Laurent Jourdren
-
-
Constructor Summary
Constructors Constructor Description TaskRunner(TaskContextImpl taskContext)
Constructor.TaskRunner(TaskContextImpl taskContext, StepStatus stepStatus)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TaskResultImpl
createStepResult(TaskContextImpl taskContext, Throwable exception)
Create a step result for an exception.static TaskResultImpl
createStepResult(TaskContextImpl taskContext, Throwable exception, String errorMessage)
Create a step result for an exception.TaskResultImpl
getResult()
Get the context result.TaskResultImpl
run()
Run the task context.static void
sendTokens(TaskContextImpl taskContext, TaskResultImpl taskResult)
Send tokens for a serialized task result.void
setForceStepInstanceReuse(boolean reuse)
Force the TaskRunner to reuse the original step instance when execute the task.
-
-
-
Constructor Detail
-
TaskRunner
public TaskRunner(TaskContextImpl taskContext)
Constructor.- Parameters:
taskContext
- task context to execute
-
TaskRunner
public TaskRunner(TaskContextImpl taskContext, StepStatus stepStatus)
Constructor.- Parameters:
taskContext
- task context to executestepStatus
- step status
-
-
Method Detail
-
getResult
public TaskResultImpl getResult()
Get the context result.- Returns:
- a TaskResult object
-
setForceStepInstanceReuse
public void setForceStepInstanceReuse(boolean reuse)
Force the TaskRunner to reuse the original step instance when execute the task.- Parameters:
reuse
- true if the step instance must be reuse when execute the task
-
run
public TaskResultImpl run()
Run the task context.- Returns:
- a task result object
-
createStepResult
public static TaskResultImpl createStepResult(TaskContextImpl taskContext, Throwable exception)
Create a step result for an exception.- Parameters:
taskContext
- task contextexception
- exception- Returns:
- a new TaskResult object
-
createStepResult
public static TaskResultImpl createStepResult(TaskContextImpl taskContext, Throwable exception, String errorMessage)
Create a step result for an exception.- Parameters:
taskContext
- task contextexception
- exceptionerrorMessage
- error message- Returns:
- a new TaskResult object
-
sendTokens
public static void sendTokens(TaskContextImpl taskContext, TaskResultImpl taskResult)
Send tokens for a serialized task result.- Parameters:
taskContext
- task contexttaskResult
- task result
-
-