@Configuration(value="org.axonframework.spring.config.AxonConfiguration") public class AxonConfiguration extends Object implements Configuration, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.context.SmartLifecycle
| Constructor and Description |
|---|
AxonConfiguration(Configurer configurer)
Initializes a new
AxonConfiguration that uses the given configurer to build the configuration. |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
CommandBus |
commandBus()
Returns the Command Bus defined in this Configuration.
|
CommandGateway |
commandGateway(CommandBus commandBus)
Returns the CommandGateway used to send commands to command handlers.
|
List<CorrelationDataProvider> |
correlationDataProviders()
Returns the Correlation Data Providers defined in this Configuration.
|
CommandBus |
defaultCommandBus() |
EventBus |
defaultEventBus() |
QueryBus |
defaultQueryBus() |
QueryUpdateEmitter |
defaultQueryUpdateEmitter() |
EventBus |
eventBus()
Retrieves the Event Bus defined in this Configuration.
|
EventProcessingConfiguration |
eventProcessingConfiguration()
Returns the
EventProcessingConfiguration defined in this Configuration. |
Serializer |
eventSerializer()
Returns the
Serializer defined in this Configuration to be used for serializing Event Message payload
and their metadata. |
<T> T |
getComponent(Class<T> componentType,
Supplier<T> defaultImpl)
Returns the Component declared under the given
componentType, typically the interface the component
implements, reverting to the given defaultImpl if no such component is defined. |
List<ModuleConfiguration> |
getModules()
Returns all modules that have been registered with this Configuration.
|
int |
getPhase() |
HandlerDefinition |
handlerDefinition(Class<?> inspectedType)
Returns the Handler Definition defined in this Configuration for the given
inspectedType. |
boolean |
isAutoStartup() |
boolean |
isRunning() |
<M extends Message<?>> |
messageMonitor(Class<?> componentType,
String componentName)
Returns the message monitor configured for a component of given
componentType and componentName. |
Serializer |
messageSerializer()
Returns the
Serializer defined in this Configuration to be used for serializing Message payloads and
metadata. |
void |
onShutdown(int phase,
Runnable shutdownHandler)
Registers a handler to be executed when the Configuration is shut down.
|
void |
onStart(int phase,
Runnable startHandler)
Registers a handler to be executed when this Configuration is started.
|
QueryBus |
queryBus() |
QueryGateway |
queryGateway(QueryBus queryBus) |
QueryUpdateEmitter |
queryUpdateEmitter()
Returns the Query Update Emitter in this Configuration.
|
<T> Repository<T> |
repository(Class<T> aggregateType)
Returns the Repository configured for the given
aggregateType. |
ResourceInjector |
resourceInjector()
Returns the ResourceInjector used to provide resources to Saga instances.
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
shutdown()
Shuts down the components defined in this Configuration
|
void |
start()
Starts this configuration.
|
void |
stop() |
void |
stop(Runnable callback) |
EventUpcasterChain |
upcasterChain()
Returns the EventUpcasterChain with all registered upcasters.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcommandGateway, deadlineManager, eventStore, findModules, getComponent, onShutdown, onStart, parameterResolverFactory, queryGateway, serializerpublic AxonConfiguration(Configurer configurer)
AxonConfiguration that uses the given configurer to build the configuration.configurer - Configuration builder for the AxonConfiguration.public CommandBus commandBus()
ConfigurationConfiguration.start()) before sending Commands over the Command Bus.commandBus in interface Configurationpublic QueryBus queryBus()
queryBus in interface Configurationpublic EventBus eventBus()
ConfigurationeventBus in interface Configurationpublic QueryUpdateEmitter queryUpdateEmitter()
ConfigurationConfiguration.start() before emitting updates over Query Update Emitter.queryUpdateEmitter in interface Configuration@Bean(value="queryBus") public QueryBus defaultQueryBus()
@Bean(value="queryUpdateEmitter") public QueryUpdateEmitter defaultQueryUpdateEmitter()
@Bean(value="commandBus") public CommandBus defaultCommandBus()
@Bean(value="eventBus") public EventBus defaultEventBus()
public ResourceInjector resourceInjector()
ConfigurationresourceInjector in interface Configurationpublic EventProcessingConfiguration eventProcessingConfiguration()
ConfigurationEventProcessingConfiguration defined in this Configuration. If there aren't any defined,
null will be returned. If there is exactly one, it will be returned. For case when there are multiple,
an AxonConfigurationException is thrown and the Configuration.getModules() API should be used instead.eventProcessingConfiguration in interface ConfigurationEventProcessingConfiguration defined in this Configuration@Bean public CommandGateway commandGateway(CommandBus commandBus)
commandBus - the command bus to be used by the gateway@Bean public QueryGateway queryGateway(QueryBus queryBus)
public <T> Repository<T> repository(Class<T> aggregateType)
ConfigurationaggregateType.repository in interface ConfigurationT - The aggregate typeaggregateType - The aggregate type to find the repository forpublic <T> T getComponent(Class<T> componentType, Supplier<T> defaultImpl)
ConfigurationcomponentType, typically the interface the component
implements, reverting to the given defaultImpl if no such component is defined.
When no component was previously registered, the default is then configured as the component for the given type.
getComponent in interface ConfigurationT - The type of componentcomponentType - The type of componentdefaultImpl - The supplier of the default to return if no component was registereddefaultImpl supplier,
if no component was registeredpublic <M extends Message<?>> MessageMonitor<? super M> messageMonitor(Class<?> componentType, String componentName)
ConfigurationcomponentType and componentName.messageMonitor in interface ConfigurationM - The type of message the monitor can deal withcomponentType - The type of component to return the monitor forcomponentName - The name of the componentpublic Serializer eventSerializer()
ConfigurationSerializer defined in this Configuration to be used for serializing Event Message payload
and their metadata.eventSerializer in interface Configurationpublic Serializer messageSerializer()
ConfigurationSerializer defined in this Configuration to be used for serializing Message payloads and
metadata.messageSerializer in interface Configurationpublic List<CorrelationDataProvider> correlationDataProviders()
ConfigurationcorrelationDataProviders in interface Configurationpublic HandlerDefinition handlerDefinition(Class<?> inspectedType)
ConfigurationinspectedType.handlerDefinition in interface ConfigurationinspectedType - The class to being inspected for handlerspublic EventUpcasterChain upcasterChain()
ConfigurationupcasterChain in interface Configurationpublic List<ModuleConfiguration> getModules()
ConfigurationgetModules in interface Configurationpublic void onStart(int phase,
Runnable startHandler)
ConfigurationThe behavior for handlers that are registered when the Configuration is already started is undefined.
onStart in interface Configurationphase - defines a phase in which the start handler will be invoked during Configuration.start() and Configuration.shutdown(). When starting the configuration
handlers are ordered in ascending, when shutting down the configuration, descending order is
used.startHandler - The handler to execute when the configuration is startedConfiguration.start(),
Configuration.onShutdown(Runnable)public void onShutdown(int phase,
Runnable shutdownHandler)
ConfigurationThe behavior for handlers that are registered when the Configuration is already shut down is undefined.
onShutdown in interface Configurationphase - defines a phase in which the shutdown handler will be invoked during Configuration.start() and Configuration.shutdown(). When starting the
configuration handlers are ordered in ascending, when shutting down the configuration,
descending order is used.shutdownHandler - The handler to execute when the Configuration is shut downConfiguration.shutdown(),
Configuration.onStart(Runnable)public void start()
Configurationstart in interface Configurationstart in interface org.springframework.context.Lifecyclepublic void shutdown()
Configurationshutdown in interface Configurationpublic void stop()
stop in interface org.springframework.context.Lifecyclepublic boolean isRunning()
isRunning in interface org.springframework.context.Lifecyclepublic boolean isAutoStartup()
isAutoStartup in interface org.springframework.context.SmartLifecyclepublic void stop(Runnable callback)
stop in interface org.springframework.context.SmartLifecyclepublic int getPhase()
getPhase in interface org.springframework.context.PhasedgetPhase in interface org.springframework.context.SmartLifecyclepublic void afterPropertiesSet()
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanpublic void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansExceptionCopyright © 2010–2018. All rights reserved.