T
- the type of the result stored in the returned ExecutionResult
objectpublic abstract class StepTask<T> extends java.lang.Object implements java.util.concurrent.Callable<ExecutionResult<T>>, java.io.Serializable
Constructor and Description |
---|
StepTask(Step source)
Constructor.
|
StepTask(Step source,
boolean resourceIntensive)
Constructor.
|
StepTask(Step source,
StepTaskCallback<T> callback)
Constructor with supplied callback.
|
StepTask(Step source,
StepTaskCallback<T> callback,
boolean resourceIntensive)
Constructor with supplied callback.
|
Modifier and Type | Method and Description |
---|---|
ExecutionResult<T> |
call()
Executor service calls this method to do the work
|
boolean |
getMustRunSingleThreaded()
Get whether this
StepTask must run single threaded - i.e. |
boolean |
isResourceIntensive()
Get whether this
StepTask is resource intensive (cpu/memory) or
not. |
abstract void |
process()
The actual work gets done here.
|
void |
setMustRunSingleThreaded(boolean singleThreaded)
Set whether this
StepTask must run single threaded - i.e. |
void |
setResourceIntensive(boolean resourceIntensive)
Set whether this
StepTask is resource intensive (cpu/memory) or
not. |
public StepTask(Step source)
source
- the source step producing this taskpublic StepTask(Step source, boolean resourceIntensive)
source
- the source step producing this taskresourceIntensive
- true if this task is cpu/memory intensivepublic StepTask(Step source, StepTaskCallback<T> callback)
source
- the source step producing this taskcallback
- the callback to usepublic StepTask(Step source, StepTaskCallback<T> callback, boolean resourceIntensive)
source
- the source step producing this taskcallback
- the callback to useresourceIntensive
- true if this task is cpu/memory intensivepublic void setResourceIntensive(boolean resourceIntensive)
StepTask
is resource intensive (cpu/memory) or
not. By default, a StepTask
is resource intensiveresourceIntensive
- false if this StepTask
is not resource
intensivepublic boolean isResourceIntensive()
StepTask
is resource intensive (cpu/memory) or
not. By default, a StepTask
is resource intensiveStepTask
is not resource intensivepublic void setMustRunSingleThreaded(boolean singleThreaded)
StepTask
must run single threaded - i.e. only
one of these tasks is executing at any one time in the JVM. The Knowledge
Flow uses a special executor service with a single worker thread to execute
these tasks. This property, if true, overrides isResourceIntensive().singleThreaded
- true if this task must run single threadedpublic boolean getMustRunSingleThreaded()
StepTask
must run single threaded - i.e. only
one of these tasks is executing at any one time in the JVM. The Knowledge
Flow uses a special executor service with a single worker thread to execute
these tasks. This property, if true, overrides isResourceIntensive().public ExecutionResult<T> call() throws java.lang.Exception
call
in interface java.util.concurrent.Callable<ExecutionResult<T>>
java.lang.Exception
public abstract void process() throws java.lang.Exception
java.lang.Exception