Package org.axonframework.config
Interface Configuration
- All Superinterfaces:
LifecycleOperations
- All Known Implementing Classes:
AxonConfiguration
Interface describing the Global Configuration for Axon components. It provides access to the components configured,
such as the Command Bus and Event Bus.
Note that certain components in the Configuration may need to be started. Therefore, before using any of the
components provided by this configuration, ensure that start() has been invoked.
- Since:
- 3.0
- Author:
- Allard Buijze
-
Method Summary
Modifier and TypeMethodDescriptiondefault <A> AggregateConfiguration<A> aggregateConfiguration(Class<A> aggregateType) Returns theAggregateConfigurationfor the givenaggregateType.default <A> AggregateFactory<A> aggregateFactory(Class<A> aggregateType) Returns theAggregateFactoryconfigured for the givenaggregateType.default CommandBusReturns the Command Bus defined in this Configuration.default CommandGatewayReturns the Command Gateway defined in this Configuration.Returns the Correlation Data Providers defined in this Configuration.default DeadlineManagerReturns theDeadlineManagerdefined in thisConfiguration.default EventBuseventBus()Retrieves the Event Bus defined in this Configuration.default EventGatewayReturns the Event Gateway defined in this Configuration.default EventProcessingConfigurationReturns theEventProcessingConfigurationdefined in this Configuration.default EventSchedulerReturns theEventSchedulerdefined in thisConfiguration.Returns theSerializerdefined in this Configuration to be used for serializing Event Message payload and their metadata.default EventStoreReturns the Event Store in this Configuration, if it is defined.default <T extends ModuleConfiguration>
List<T> findModules(Class<T> moduleType) Finds all configuration modules of givenmoduleTypewithin this configuration.default <T> TgetComponent(Class<T> componentType) Returns the Component declared under the givencomponentType, typically the interface the component implements.<T> TgetComponent(Class<T> componentType, Supplier<T> defaultImpl) Returns the Component declared under the givencomponentType, typically the interface the component implements, reverting to the givendefaultImplif no such component is defined.Returns all modules that have been registered with this Configuration.handlerDefinition(Class<?> inspectedType) Returns the Handler Definition defined in this Configuration for the giveninspectedType.default Lifecycle.LifecycleRegistryReturns the lifecycle registry for this configuration.<M extends Message<?>>
MessageMonitor<? super M> messageMonitor(Class<?> componentType, String componentName) Returns the message monitor configured for a component of givencomponentTypeandcomponentName.Returns theSerializerdefined in this Configuration to be used for serializing Message payloads and metadata.default ParameterResolverFactoryReturns the Parameter Resolver Factory defined in this Configurationdefault QueryBusqueryBus()default QueryGatewayReturns the Query Gateway defined in this Configuration.default QueryUpdateEmitterReturns the Query Update Emitter in this Configuration.default <A> Repository<A> repository(Class<A> aggregateType) Returns theRepositoryconfigured for the givenaggregateType.default ResourceInjectorReturns the ResourceInjector used to provide resources to Saga instances.default ScopeAwareProviderReturns theScopeAwareProviderdefined in the Configuration.default SerializerReturns the serializer defined in this Configurationvoidshutdown()Shuts down the components defined in this Configurationdefault SnapshotFilterReturns theSnapshotFiltercombining all defined filters perAggregateConfigurerin anSnapshotFilter.combine(SnapshotFilter)operation.default SnapshotterReturns theSnapshotterdefined in this Configuration.default SpanFactoryReturns theSpanFactorydefined in this configuration.voidstart()Starts this configuration.default TagsConfigurationtags()Returns the Tags Configuration defined in this Configuration.Returns the EventUpcasterChain with all registered upcasters.Methods inherited from interface org.axonframework.config.LifecycleOperations
onShutdown, onShutdown, onShutdown, onStart, onStart, onStart
-
Method Details
-
eventBus
Retrieves the Event Bus defined in this Configuration.- Returns:
- the Event Bus defined in this Configuration
-
lifecycleRegistry
Returns the lifecycle registry for this configuration. Typically, this is just an adapter around the configuration itself to register individual handler methods.- Returns:
- the lifecycle registry for this configuration
-
eventStore
Returns the Event Store in this Configuration, if it is defined. If no Event Store is defined (but an Event Bus instead), this method throws anAxonConfigurationException.- Returns:
- the Event Store defined in this Configuration
-
findModules
Finds all configuration modules of givenmoduleTypewithin this configuration.- Type Parameters:
T- The type of the configuration module- Parameters:
moduleType- The type of the configuration module- Returns:
- configuration modules of
moduleTypedefined in this configuration
-
commandBus
Returns the Command Bus defined in this Configuration. Note that this Configuration should be started (seestart()) before sending Commands over the Command Bus.- Returns:
- the CommandBus defined in this configuration
-
queryBus
-
queryUpdateEmitter
Returns the Query Update Emitter in this Configuration. Note that this Configuration should be started (seestart()before emitting updates over Query Update Emitter.- Returns:
- the QueryUpdateEmitter defined in this configuration
-
resourceInjector
Returns the ResourceInjector used to provide resources to Saga instances.- Returns:
- the ResourceInjector used to provide resources to Saga instances
-
commandGateway
Returns the Command Gateway defined in this Configuration. Note that this Configuration should be started (seestart()) before sending Commands using this Command Gateway.- Returns:
- the CommandGateway defined in this configuration
-
eventProcessingConfiguration
default EventProcessingConfiguration eventProcessingConfiguration() throws AxonConfigurationExceptionReturns theEventProcessingConfigurationdefined in this Configuration. If there aren't any defined,nullwill be returned. If there is exactly one, it will be returned. For case when there are multiple, anAxonConfigurationExceptionis thrown and thegetModules()API should be used instead.- Returns:
- the
EventProcessingConfigurationdefined in this Configuration - Throws:
AxonConfigurationException- thrown if there are more than one Event Processing Configurations defined with this configuration
-
queryGateway
Returns the Query Gateway defined in this Configuration. Note that this Configuration should be started (seestart()) before sending Queries using this Query Gateway.- Returns:
- the QueryGateway defined in this configuration
-
eventGateway
Returns the Event Gateway defined in this Configuration.- Returns:
- the EventGateway defined in this configuration
-
tags
Returns the Tags Configuration defined in this Configuration.- Returns:
- the Tags Configuration defined in this Configuration
-
spanFactory
Returns theSpanFactorydefined in this configuration.- Returns:
- the
SpanFactorydefined in this configuration.
-
aggregateConfiguration
Returns theAggregateConfigurationfor the givenaggregateType.- Type Parameters:
A- the aggregate type- Parameters:
aggregateType- the aggregate type to find theAggregateConfigurationfor- Returns:
- the
AggregateConfigurationfor the givenaggregateType
-
repository
Returns theRepositoryconfigured for the givenaggregateType.- Type Parameters:
A- the aggregate type- Parameters:
aggregateType- the aggregate type to find theRepositoryfor- Returns:
- the
Repositoryfrom which aggregates of the givenaggregateTypecan be loaded
-
aggregateFactory
Returns theAggregateFactoryconfigured for the givenaggregateType.- Type Parameters:
A- the aggregate type- Parameters:
aggregateType- the aggregate type to find theAggregateFactoryfor- Returns:
- the
AggregateFactorywhich constructs aggregate of the givenaggregateType
-
getComponent
Returns the Component declared under the givencomponentType, typically the interface the component implements.- Type Parameters:
T- The type of component- Parameters:
componentType- The type of component- Returns:
- the component registered for the given type, or
nullif no such component exists
-
getComponent
Returns the Component declared under the givencomponentType, typically the interface the component implements, reverting to the givendefaultImplif no such component is defined.When no component was previously registered, the default is then configured as the component for the given type.
- Type Parameters:
T- The type of component- Parameters:
componentType- The type of componentdefaultImpl- The supplier of the default to return if no component was registered- Returns:
- the component registered for the given type, or the value returned by the
defaultImplsupplier, if no component was registered
-
messageMonitor
<M extends Message<?>> MessageMonitor<? super M> messageMonitor(@Nonnull Class<?> componentType, @Nonnull String componentName) Returns the message monitor configured for a component of givencomponentTypeandcomponentName.- Type Parameters:
M- The type of message the monitor can deal with- Parameters:
componentType- The type of component to return the monitor forcomponentName- The name of the component- Returns:
- The monitor to be used for the described component
-
serializer
Returns the serializer defined in this Configuration- Returns:
- the serializer defined in this Configuration
-
eventSerializer
Serializer eventSerializer()Returns theSerializerdefined in this Configuration to be used for serializing Event Message payload and their metadata.- Returns:
- the event serializer defined in this Configuration.
-
messageSerializer
Serializer messageSerializer()Returns theSerializerdefined in this Configuration to be used for serializing Message payloads and metadata.- Returns:
- the message serializer defined in this Configuration.
-
start
void start()Starts this configuration. All components defined in this Configuration will be started. -
shutdown
void shutdown()Shuts down the components defined in this Configuration -
correlationDataProviders
List<CorrelationDataProvider> correlationDataProviders()Returns the Correlation Data Providers defined in this Configuration.- Returns:
- the Correlation Data Providers defined in this Configuration
-
parameterResolverFactory
Returns the Parameter Resolver Factory defined in this Configuration- Returns:
- the Parameter Resolver Factory defined in this Configuration
-
handlerDefinition
Returns the Handler Definition defined in this Configuration for the giveninspectedType.- Parameters:
inspectedType- The class to being inspected for handlers- Returns:
- the Handler Definition defined in this Configuration
-
eventScheduler
Returns theEventSchedulerdefined in thisConfiguration.- Returns:
- the
EventSchedulerdefined in thisConfiguration
-
deadlineManager
Returns theDeadlineManagerdefined in thisConfiguration.- Returns:
- the
DeadlineManagerdefined in thisConfiguration
-
snapshotter
Returns theSnapshotterdefined in this Configuration.- Returns:
- the
Snapshotterdefined in this Configuration
-
scopeAwareProvider
Returns theScopeAwareProviderdefined in the Configuration.- Returns:
- the
ScopeAwareProviderdefined in the Configuration
-
getModules
List<ModuleConfiguration> getModules()Returns all modules that have been registered with this Configuration.- Returns:
- all modules that have been registered with this Configuration
-
upcasterChain
EventUpcasterChain upcasterChain()Returns the EventUpcasterChain with all registered upcasters.- Returns:
- the EventUpcasterChain with all registered upcasters
-
snapshotFilter
Returns theSnapshotFiltercombining all defined filters perAggregateConfigurerin anSnapshotFilter.combine(SnapshotFilter)operation.- Returns:
- the
SnapshotFiltercombining all defined filters perAggregateConfigurer
-