Package com.onenetwork.platform.grid
Class AbstractTaskPerformer
java.lang.Object
com.onenetwork.platform.grid.AbstractTaskPerformer
- All Implemented Interfaces:
TaskPerformer
public abstract class AbstractTaskPerformer extends java.lang.Object implements TaskPerformer
Abstract implementation of
TaskPerformer
which is recommended as the base
for all clients. It gives access to additional properties not available to
simple direct TaskPerformer implementations, such as GridTaskContext
.-
Constructor Summary
Constructors Constructor Description AbstractTaskPerformer()
-
Method Summary
Modifier and Type Method Description void
addToFailTransaction(java.lang.String taskParams, java.lang.String taskInput, java.lang.String reason)
Default implementation does nothing.void
addToRetryTransaction(java.lang.String taskParams, java.lang.String taskInput, java.lang.String reason)
Default implementation does nothing.protected GridTaskContext
getGridTaskContext()
Returns aGridTaskContext
which provides additional information about the GridTask currently being executed.TaskPerformerConfig
getTaskPerformerConfig()
Returns the TaskPerformerConfig for this task performer.void
setGridTaskContext(GridTaskContext gridTaskContext)
Sets theGridTaskContext
on this performer.void
setTaskPerformerConfig(TaskPerformerConfig taskPerformerConfig)
Sets the TaskPerformerConfig on this task performer.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.onenetwork.platform.grid.TaskPerformer
getTaskType, performTask
-
Constructor Details
-
AbstractTaskPerformer
public AbstractTaskPerformer()
-
-
Method Details
-
addToFailTransaction
public void addToFailTransaction(java.lang.String taskParams, java.lang.String taskInput, java.lang.String reason)Default implementation does nothing.- Specified by:
addToFailTransaction
in interfaceTaskPerformer
- Parameters:
taskParams
- parameters supplied when task was createdtaskInput
- the output of the task this task depends onreason
- a description of what caused the task to fail
-
addToRetryTransaction
public void addToRetryTransaction(java.lang.String taskParams, java.lang.String taskInput, java.lang.String reason)Default implementation does nothing.- Specified by:
addToRetryTransaction
in interfaceTaskPerformer
- Parameters:
taskParams
- parameters supplied when task was createdtaskInput
- the output of the task this task depends onreason
- a description of what caused the task to retry
-
setGridTaskContext
Sets theGridTaskContext
on this performer. -
getGridTaskContext
Returns aGridTaskContext
which provides additional information about the GridTask currently being executed.- Returns:
- gridTaskContext
-
setTaskPerformerConfig
Description copied from interface:TaskPerformer
Sets the TaskPerformerConfig on this task performer. This includes any parameterization of the behavior of this performer specified in that configuration- Specified by:
setTaskPerformerConfig
in interfaceTaskPerformer
- Parameters:
taskPerformerConfig
- configuration for this task performer
-
getTaskPerformerConfig
Description copied from interface:TaskPerformer
Returns the TaskPerformerConfig for this task performer. This includes any parameterization of the behavior of this performer specified in that configuration.- Specified by:
getTaskPerformerConfig
in interfaceTaskPerformer
- Returns:
- TaskPerformerConfig for this task performer
-