Package org.axonframework.config
Interface EventProcessingConfiguration
- All Known Implementing Classes:
EventProcessingModule
public interface EventProcessingConfiguration
Defines a contract for accessor methods regarding event processing configuration.
- Since:
- 4.0
- Author:
- Milan Savic
-
Method Summary
Modifier and TypeMethodDescriptiondefault Optional<EnqueuePolicy<EventMessage<?>>> deadLetterPolicy(String processingGroup) default Optional<SequencedDeadLetterQueue<EventMessage<?>>> deadLetterQueue(String processingGroup) errorHandler(String processorName) Returns theErrorHandlertied to the givenprocessorName.default <T extends EventProcessor>
Optional<T> eventProcessor(String name) Obtains anEventProcessorthrough the givenname.default <T extends EventProcessor>
Optional<T> eventProcessor(String name, Class<T> expectedType) <T extends EventProcessor>
Optional<T> eventProcessorByProcessingGroup(String processingGroup) Obtains anEventProcessorby it'sprocessingGroup.default <T extends EventProcessor>
Optional<T> eventProcessorByProcessingGroup(String processingGroup, Class<T> expectedType) Obtains all registeredEventProcessors.List<MessageHandlerInterceptor<? super EventMessage<?>>> interceptorsFor(String processorName) listenerInvocationErrorHandler(String processingGroup) Returns theListenerInvocationErrorHandlertied to the givenprocessingGroup.MessageMonitor<? super Message<?>> messageMonitor(Class<?> componentType, String componentName) Returns theMessageMonitorset to the givencomponentTypeandcomponentNameregistered within this configuration.rollbackConfiguration(String processorName) Returns theRollbackConfigurationtied to the givenprocessorName.default <T> SagaConfiguration<T> sagaConfiguration(Class<T> sagaType) Returns theSagaConfigurationfor the givensagaType.Returns aListofSagaConfigurations registered within this configuration.default <T extends EventProcessor>
Optional<T> sagaEventProcessor(Class<?> sagaType) Obtains an SagaEventProcessorimplementation for the givensagaType.sagaProcessingGroup(Class<?> sagaType) Gets the processing group for givensagaType.Returns aSagaStoreregistered within this configuration.default Optional<SequencedDeadLetterProcessor<EventMessage<?>>> sequencedDeadLetterProcessor(String processingGroup) SequencingPolicy<? super EventMessage<?>> sequencingPolicy(String processingGroup) Returns theSequencingPolicytied to the givenprocessingGroup.tokenStore(String processorName) Returns theTokenStoretied to the givenprocessorName.transactionManager(String processorName) Returns theTransactionManagertied to the givenprocessorName.
-
Method Details
-
eventProcessor
Obtains anEventProcessorthrough the givenname.- Type Parameters:
T- the type of the expectedEventProcessor- Parameters:
name- aStringspecifying the name of anEventProcessor- Returns:
- an
Optionalspecifying whether anEventProcessorwith the givennameexists
-
sagaEventProcessor
Obtains an SagaEventProcessorimplementation for the givensagaType.- Type Parameters:
T- the type of the expectedEventProcessor- Parameters:
sagaType- the type of Saga for which to get the Event Processor- Returns:
- an
Optionalspecifying whether anEventProcessorfor the givenSagaConfigurationexists
-
eventProcessor
- Type Parameters:
T- the type of the expectedEventProcessor- Parameters:
name- aStringspecifying the name of theEventProcessorto returnexpectedType- the type of theEventProcessorto return- Returns:
- an
Optionalreferencing theEventProcessor, if present and of expected type
-
eventProcessorByProcessingGroup
Obtains anEventProcessorby it'sprocessingGroup.- Type Parameters:
T- the type of the expectedEventProcessor- Parameters:
processingGroup- aStringspecifying the processing group of anEventProcessor- Returns:
- an
Optionalreferencing theEventProcessor
-
eventProcessorByProcessingGroup
default <T extends EventProcessor> Optional<T> eventProcessorByProcessingGroup(String processingGroup, Class<T> expectedType) - Type Parameters:
T- the type of the expectedEventProcessor- Parameters:
processingGroup- aStringspecifying the processing group of anEventProcessorexpectedType- the type of theEventProcessorto return- Returns:
- an
Optionalreferencing theEventProcessor, if present and of expected type
-
eventProcessors
Map<String,EventProcessor> eventProcessors()Obtains all registeredEventProcessors.- Returns:
- a
Mapof registeredEventProcessors within this configuration with the processor names as keys
-
sagaProcessingGroup
Gets the processing group for givensagaType.- Parameters:
sagaType- the type of Saga- Returns:
- the processing group
-
interceptorsFor
- Parameters:
processorName- aStringspecifying a processing group- Returns:
- a
ListofMessageHandlerInterceptors for a processor with givenprocessorName
-
listenerInvocationErrorHandler
Returns theListenerInvocationErrorHandlertied to the givenprocessingGroup.- Parameters:
processingGroup- aStringspecifying a processing group- Returns:
- the
ListenerInvocationErrorHandlerbelonging to the givenprocessingGroup
-
sequencingPolicy
Returns theSequencingPolicytied to the givenprocessingGroup.- Parameters:
processingGroup- aStringspecifying a processing group- Returns:
- the
SequencingPolicybelonging to the givenprocessingGroup
-
rollbackConfiguration
Returns theRollbackConfigurationtied to the givenprocessorName.- Parameters:
processorName- aStringspecifying a processing group- Returns:
- the
RollbackConfigurationbelonging to the givenprocessorName
-
errorHandler
Returns theErrorHandlertied to the givenprocessorName.- Parameters:
processorName- aStringspecifying a processing group- Returns:
- the
ErrorHandlerbelonging to the givenprocessorName
-
sagaStore
SagaStore sagaStore()Returns aSagaStoreregistered within this configuration.- Returns:
- a
SagaStoreregistered within this configuration
-
sagaConfigurations
List<SagaConfiguration<?>> sagaConfigurations()Returns aListofSagaConfigurations registered within this configuration.- Returns:
- a
ListofSagaConfigurations registered within this configuration
-
sagaConfiguration
Returns theSagaConfigurationfor the givensagaType. If no configuration has been provided for a Saga of this type,nullis returned.- Type Parameters:
T- the type of Saga- Parameters:
sagaType- the type of Saga to return the configuration for.- Returns:
- the configuration for the Saga, or
nullif not found
-
messageMonitor
Returns theMessageMonitorset to the givencomponentTypeandcomponentNameregistered within this configuration.- Parameters:
componentType- aClasstype of component to be monitoredcomponentName- aStringspecifying the name of the component to be monitored- Returns:
- the
MessageMonitorregistered to the givencomponentTypeandcomponentName
-
tokenStore
Returns theTokenStoretied to the givenprocessorName.- Parameters:
processorName- aStringspecifying a event processor- Returns:
- the
TokenStorebelonging to the givenprocessorName
-
transactionManager
Returns theTransactionManagertied to the givenprocessorName.- Parameters:
processorName- aStringspecifying a processing group- Returns:
- the
TransactionManagerbelonging to the givenprocessorName
-
deadLetterQueue
default Optional<SequencedDeadLetterQueue<EventMessage<?>>> deadLetterQueue(@Nonnull String processingGroup) Returns theSequencedDeadLetterQueuetied to the givenprocessingGroupin anOptional. May return anempty optionalwhen there's noSequencedDeadLetterQueuepresent for the givenprocessingGroup.- Parameters:
processingGroup- The name of the processing group for which to return aSequencedDeadLetterQueue.- Returns:
- The
SequencedDeadLetterQueuetied to the givenprocessingGroup,Optional.empty()if there is none.
-
deadLetterPolicy
Returns thedead letter policytied to the givenprocessingGroupin anOptional. May return anOptionalcontaining thedefault policyif present.- Parameters:
processingGroup- The name of the processing group for which to return anEnqueuePolicy.- Returns:
- The
EnqueuePolicybelonging to the givenprocessingGroup.
-
sequencedDeadLetterProcessor
default Optional<SequencedDeadLetterProcessor<EventMessage<?>>> sequencedDeadLetterProcessor(@Nonnull String processingGroup) Returns theSequencedDeadLetterProcessortied to the givenprocessingGroupin anOptional. Returns anempty optionalwhen theprocessingGroupdoes not have aSequencedDeadLetterQueueattached to it.- Parameters:
processingGroup- The name of the processing group for which to return anEnqueuePolicy.- Returns:
- The
SequencedDeadLetterProcessortied to the givenprocessingGroupin anOptional,Optional.empty()if there is none.
-