public final class ProcessorExecutionContext
extends java.lang.Object
| Constructor and Description |
|---|
ProcessorExecutionContext(Values values)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
allAreFinished(java.util.Set<ProcessorGraphNode<?,?>> processorNodes)
Verify that all processors have finished executing atomically (within the same lock as
finished(ProcessorGraphNode) and isFinished(ProcessorGraphNode) is within. |
void |
cancel()
Set a
cancel flag. |
void |
finished(ProcessorGraphNode processorGraphNode)
Flag that the processor has completed execution.
|
AbstractProcessor.Context |
getContext() |
java.lang.String |
getJobId() |
Values |
getValues() |
boolean |
isFinished(ProcessorGraphNode processorGraphNode)
Return true if the processor of the node has previously been executed.
|
boolean |
isRunning(ProcessorGraphNode processorGraphNode)
Return true if the processor of the node is currently being executed.
|
boolean |
tryStart(ProcessorGraphNode processorGraphNode)
Try to start the node of a processor.
|
public ProcessorExecutionContext(Values values)
values - the values object.public Values getValues()
public boolean tryStart(ProcessorGraphNode processorGraphNode)
In case the processor is already running, has already finished or if not all requirements have finished, the processor can not start. If the above conditions are fulfilled, the processor is added to the list of running processors, and is expected to be started from the caller.
processorGraphNode - the node that should start.public boolean isRunning(ProcessorGraphNode processorGraphNode)
processorGraphNode - the node to test.public boolean isFinished(ProcessorGraphNode processorGraphNode)
processorGraphNode - the node to test.public void finished(ProcessorGraphNode processorGraphNode)
processorGraphNode - the node that has finished.public boolean allAreFinished(java.util.Set<ProcessorGraphNode<?,?>> processorNodes)
finished(ProcessorGraphNode) and isFinished(ProcessorGraphNode) is within.processorNodes - the node to check for completion.public void cancel()
cancel flag.
All processors are supposed to check this flag frequently and terminate the execution if requested.
public AbstractProcessor.Context getContext()
public java.lang.String getJobId()