Class DocprocExecutor

java.lang.Object
com.yahoo.docproc.impl.DocprocExecutor

public class DocprocExecutor extends Object
An executor executed incoming processings on its CallStack
Author:
Einar M R Rosenvinge
  • Constructor Details

    • DocprocExecutor

      public DocprocExecutor(String name, CallStack callStack)
      Creates a new named DocprocExecutor with the given CallStack.
      Parameters:
      name - the name of this executor
      callStack - the chain of document processors this executor shall execute on processings
    • DocprocExecutor

      public DocprocExecutor(DocprocExecutor oldExecutor, CallStack callStack)
      Creates a new named DocprocExecutor, with the same instance variables as the given executor, but a new call stack.
      Parameters:
      oldExecutor - the executor to inherit the instance variables from, sans call stack.
      callStack - the call stack to use.
  • Method Details

    • getCallStack

      public CallStack getCallStack()
    • getName

      public String getName()
    • process

      public DocumentProcessor.Progress process(Processing processing)
      Processes a given Processing through the CallStack of this executor.
      Parameters:
      processing - the Processing to process. The CallStack of the Processing will be set to a clone of the CallStack of this executor, iff. it is currently null.
      Returns:
      a Progress; if this is LATER, the Processing is not done and must be reprocessed later.
      Throws:
      RuntimeException - if a document processor throws an exception during processing.
      See Also:
    • processUntilDone

      public DocumentProcessor.Progress processUntilDone(Processing processing)
      Processes a given Processing through the CallStack of this executor. Note that if a DocumentProcessor returns a LaterProgress for this processing, it will be re-processed (after waiting the specified delay given by the LaterProgress), until done or failed.
      Parameters:
      processing - the Processing to process. The CallStack of the Processing will be set to a clone of the CallStack of this executor, iff. it is currently null.
      Returns:
      a Progress; this is never a LaterProgress.
      Throws:
      RuntimeException - if a document processor throws an exception during processing, or this thread is interrupted while waiting.
      See Also: