Interface CommandProcessor<T extends UnifiedRecordValue>
- All Known Implementing Classes:
CreateProcessInstanceProcessor,CreateProcessInstanceWithResultProcessor,JobCancelProcessor,JobCompleteProcessor,JobFailProcessor,JobRecurProcessor,JobThrowErrorProcessor,JobTimeOutProcessor,JobUpdateRetriesProcessor
public interface CommandProcessor<T extends UnifiedRecordValue>
High-level record processor abstraction that implements the common behavior of most
command-handling processors.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondefault voidafterAccept(TypedCommandWriter commandWriter, StateWriter stateWriter, long key, Intent intent, T value) default booleanonCommand(TypedRecord<T> command, CommandProcessor.CommandControl<T> commandControl) tryHandleError(TypedRecord<T> command, Throwable error) Try to handle an error that occurred during processing.
-
Method Details
-
onCommand
default boolean onCommand(TypedRecord<T> command, CommandProcessor.CommandControl<T> commandControl) -
afterAccept
default void afterAccept(TypedCommandWriter commandWriter, StateWriter stateWriter, long key, Intent intent, T value) -
tryHandleError
default TypedRecordProcessor.ProcessingError tryHandleError(TypedRecord<T> command, Throwable error) Try to handle an error that occurred during processing.- Parameters:
command- The command that was being processed when the error occurrederror- The error that occurred, and the processor should attempt to handle- Returns:
- The type of the processing error. Default:
TypedRecordProcessor.ProcessingError.UNEXPECTED_ERROR.
-