Package com.persequor.extension.common
Interface ISagaExecutionContextService
public interface ISagaExecutionContextService
Service for registering callbacks to be executed when the execution context is done.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
static class
static interface
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Register a callback to be executed when the execution context is done.void
onContextDone
(ISagaExecutionContextService.SagaContextCallback callback, ISagaExecutionContextService.ExecutionContextType typeFilter) Register a callback to be executed when the execution context is done.void
onContextDone
(ISagaExecutionContextService.SagaContextCallback callback, ISagaExecutionContextService.ExecutionContextType... typeFilters) Register a callback to be executed when the execution context is done.
-
Method Details
-
onContextDone
Register a callback to be executed when the execution context is done.The callbacks will be executed in the order they were registered.
The callback will be executed in the same thread as the context that just finished.
If the callback throws an exception, it will be logged but otherwise ignored.
Callbacks registered in this way are persistent and will be executed for all future execution contexts. As such they should be registered as early as relevant, in a singleton context.
- Parameters:
callback
- The callback to execute
-
onContextDone
void onContextDone(ISagaExecutionContextService.SagaContextCallback callback, ISagaExecutionContextService.ExecutionContextType typeFilter) Register a callback to be executed when the execution context is done.Is filtered by the execution context type.
See
onContextDone(SagaContextCallback)
for more information.- Parameters:
callback
- The callback to executetypeFilter
- The execution context type to filter on
-
onContextDone
void onContextDone(ISagaExecutionContextService.SagaContextCallback callback, ISagaExecutionContextService.ExecutionContextType... typeFilters) Register a callback to be executed when the execution context is done.Is filtered by the execution context type. If ANY of the types in the filter matches, the callback will be executed.
See
onContextDone(SagaContextCallback)
for more information.- Parameters:
callback
- The callback to executetypeFilters
- The execution context types to filter on
-