Class ProcessorExecutionContext

java.lang.Object
org.mapfish.print.processor.ProcessorExecutionContext

public final class ProcessorExecutionContext extends Object
Contains information shared across all nodes being executed.
  • Constructor Details

    • ProcessorExecutionContext

      public ProcessorExecutionContext(Values values)
      Constructor.
      Parameters:
      values - the values object.
  • Method Details

    • getValues

      public Values getValues()
    • tryStart

      public boolean tryStart(ProcessorGraphNode processorGraphNode)
      Try to start the node of a processor.

      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.

      Parameters:
      processorGraphNode - the node that should start.
      Returns:
      if the node of the processor can be started.
    • isRunning

      public boolean isRunning(ProcessorGraphNode processorGraphNode)
      Return true if the processor of the node is currently being executed.
      Parameters:
      processorGraphNode - the node to test.
    • isFinished

      public boolean isFinished(ProcessorGraphNode processorGraphNode)
      Return true if the processor of the node has previously been executed.
      Parameters:
      processorGraphNode - the node to test.
    • finished

      public void finished(ProcessorGraphNode processorGraphNode)
      Flag that the processor has completed execution.
      Parameters:
      processorGraphNode - the node that has finished.
    • allAreFinished

      public boolean allAreFinished(Set<ProcessorGraphNode<?,?>> processorNodes)
      Verify that all processors have finished executing atomically (within the same lock as finished(ProcessorGraphNode) and isFinished(ProcessorGraphNode) is within.
      Parameters:
      processorNodes - the node to check for completion.
    • cancel

      public void cancel()
      Set a cancel flag.

      All processors are supposed to check this flag frequently and terminate the execution if requested.

    • getContext

      public AbstractProcessor.Context getContext()
    • getMDCContext

      public Map<String,String> getMDCContext()