Package com.yahoo.docproc
Class DocprocExecutor
- java.lang.Object
-
- com.yahoo.docproc.DocprocExecutor
-
public class DocprocExecutor extends java.lang.Object
An executor executed incoming processings on its CallStack- Author:
- Einar M R Rosenvinge
-
-
Constructor Summary
Constructors Constructor Description DocprocExecutor(DocprocExecutor oldExecutor, CallStack callStack)
Creates a new named DocprocExecutor, with the same instance variables as the given executor, but a new call stack.DocprocExecutor(java.lang.String name, CallStack callStack)
Creates a new named DocprocExecutor with the given CallStack.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CallStack
getCallStack()
java.lang.String
getName()
DocumentProcessor.Progress
process(Processing processing)
Processes a given Processing through the CallStack of this executor.DocumentProcessor.Progress
processUntilDone(Processing processing)
Processes a given Processing through the CallStack of this executor.
-
-
-
Constructor Detail
-
DocprocExecutor
public DocprocExecutor(java.lang.String name, CallStack callStack)
Creates a new named DocprocExecutor with the given CallStack.- Parameters:
name
- the name of this executorcallStack
- 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 Detail
-
getCallStack
public CallStack getCallStack()
-
getName
public java.lang.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:
java.lang.RuntimeException
- if a document processor throws an exception during processing.- See Also:
Processing
-
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:
java.lang.RuntimeException
- if a document processor throws an exception during processing, or this thread is interrupted while waiting.- See Also:
Processing
,DocumentProcessor.Progress
,DocumentProcessor.LaterProgress
-
-