public abstract class ProcessingWorker extends java.lang.Object implements Worker
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
_binStorageAvailable
use bin storage?
|
protected BlackboardFactory |
_blackboardFactory
blackboard factory.
|
protected Log |
_log
protected log.
|
static java.lang.String |
INPUT_SLOT_NAME
the workers input slot name .
|
static java.lang.String |
KEY_KEEPATTACHMENTSINMEMORY
name for "keep attachments in memory" parameter.
|
static java.lang.String |
KEY_WRITEATTACHMENTSTOOUTPUT
name for "write attachments to output" parameter.
|
static java.lang.String |
OUTPUT_SLOT_NAME
the workers output slot name .
|
| Constructor and Description |
|---|
ProcessingWorker() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
cleanupBlackboard(Blackboard blackboard,
TaskContext taskContext) |
protected Blackboard |
getBlackboard(TaskContext taskContext)
Creates the blackboard to hold the records during processing
|
abstract boolean |
perform(AnyMap parameters,
RecordInput recordInput,
RecordOutput recordOutput,
TaskContext taskContext) |
void |
perform(TaskContext taskContext)
Performs a computation on the data available in the
TaskContext, such as a task for this worker, input and
(if configured) output slots. |
void |
setBlackboardFactory(BlackboardFactory factory)
set blackboard factory reference (used by DS).
|
void |
unsetBlackboardFactory(BlackboardFactory factory)
remove blackboard factory reference (used by DS).
|
protected void |
writeResultRecords(Blackboard blackboard,
java.lang.String[] resultIds,
RecordOutput recordOutput,
TaskContext taskContext)
append the resulting records to the bulk.
|
public static final java.lang.String INPUT_SLOT_NAME
public static final java.lang.String OUTPUT_SLOT_NAME
public static final java.lang.String KEY_KEEPATTACHMENTSINMEMORY
public static final java.lang.String KEY_WRITEATTACHMENTSTOOUTPUT
protected final Log _log
protected BlackboardFactory _blackboardFactory
protected boolean _binStorageAvailable
public abstract boolean perform(AnyMap parameters, RecordInput recordInput, RecordOutput recordOutput, TaskContext taskContext) throws java.lang.Exception
parameters - task parameters, converted to an AnyMaprecordInput - input bulkrecordOutput - output bulk, can be nulltaskContext - task contextjava.lang.Exception - bulk could not be processedpublic void perform(TaskContext taskContext) throws java.lang.Exception
WorkerTaskContext, such as a task for this worker, input and
(if configured) output slots. An implementor must make sure, calls to this method must be thread-safe!protected void writeResultRecords(Blackboard blackboard, java.lang.String[] resultIds, RecordOutput recordOutput, TaskContext taskContext) throws ObjectStoreException, java.io.IOException
recordOutput - where to write the records. Can be null (is optional in worker description)ObjectStoreExceptionjava.io.IOExceptionprotected void cleanupBlackboard(Blackboard blackboard, TaskContext taskContext)
protected Blackboard getBlackboard(TaskContext taskContext) throws java.lang.Exception
java.lang.Exceptionpublic void setBlackboardFactory(BlackboardFactory factory)
public void unsetBlackboardFactory(BlackboardFactory factory)