Class AxonServerAutoConfiguration
java.lang.Object
org.axonframework.extension.springboot.autoconfig.AxonServerAutoConfiguration
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
@AutoConfiguration
@AutoConfigureBefore(AxonAutoConfiguration.class)
@ConditionalOnClass(AxonServerConfiguration.class)
@EnableConfigurationProperties(AxonServerConfiguration.class)
public class AxonServerAutoConfiguration
extends Object
implements org.springframework.context.ApplicationContextAware
Base Axon Server Autoconfiguration.
Constructs the AxonServerConfiguration, allowing for further configuration of Axon Server components through
property files or complete disablement of Axon Server.
- Since:
- 4.0.0
- Author:
- Marc Gathier
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intConstant specifying the order used todecoratetheAxonServerConfigurationandDistributedCommandBusConfigurationwith specifics of the Spring Boot autoconfiguration. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBean creation method constructing aConfigurationEnhancerthat decorates theAxonServerConfigurationandDistributedCommandBusConfiguration.axonServerConfigurationWithConnectionDetails(AxonServerConnectionDetails connectionDetails) Bean creation method constructing aConfigurationEnhancerthat uses the availableAxonServerConnectionDetailsto specify theAxonServerConfiguration.getServers().Bean creation method constructing aConfigurationEnhancerthat disables Axon Server that is only constructed whenaxon.axonserver.enabledis set tofalse.voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) topologyChangeListenerConfigurerModule(List<TopologyChangeListener> changeListeners) Bean creation method constructing aConfigurationEnhancerthat uses the availableTopologyChangeListenersand registers them with theAxonServerConnectionManager.
-
Field Details
-
AXON_SERVER_CONFIGURATION_ENHANCEMENT_ORDER
public static final int AXON_SERVER_CONFIGURATION_ENHANCEMENT_ORDERConstant specifying the order used todecoratetheAxonServerConfigurationandDistributedCommandBusConfigurationwith specifics of the Spring Boot autoconfiguration.- See Also:
-
-
Constructor Details
-
AxonServerAutoConfiguration
public AxonServerAutoConfiguration()
-
-
Method Details
-
disableAxonServerConfigurationEnhancer
@Bean @ConditionalOnProperty(name="axon.axonserver.enabled", havingValue="false") public ConfigurationEnhancer disableAxonServerConfigurationEnhancer()Bean creation method constructing aConfigurationEnhancerthat disables Axon Server that is only constructed whenaxon.axonserver.enabledis set tofalse.- Returns:
- A
ConfigurationEnhancerdisabling Axon Server that is only constructed whenaxon.axonserver.enabledis set tofalse.
-
axonServerConfigurationEnhancer
@Bean @ConditionalOnProperty(name="axon.axonserver.enabled", matchIfMissing=true) public ConfigurationEnhancer axonServerConfigurationEnhancer()Bean creation method constructing aConfigurationEnhancerthat decorates theAxonServerConfigurationandDistributedCommandBusConfiguration.This enhancer will set the
component nameto theApplicationContext.getId(). Furthermore, it will set theto align with theinvalid reference
DistributedCommandBusConfiguration#numberOfThreads(int)AxonServerConfiguration.getCommandThreads()property.This enhancer is only constructed when
axon.axonserver.enabledis set totrue.- Returns:
- A
ConfigurationEnhancerthat decorates theAxonServerConfigurationandDistributedCommandBusConfiguration.
-
axonServerConfigurationWithConnectionDetails
@Bean @ConditionalOnBean(AxonServerConnectionDetails.class) @ConditionalOnProperty(name="axon.axonserver.enabled", matchIfMissing=true) public ConfigurationEnhancer axonServerConfigurationWithConnectionDetails(AxonServerConnectionDetails connectionDetails) Bean creation method constructing aConfigurationEnhancerthat uses the availableAxonServerConnectionDetailsto specify theAxonServerConfiguration.getServers().- Parameters:
connectionDetails- The connection details, if present, to define theAxonServerConfiguration.getServers()with.- Returns:
- A
ConfigurationEnhancerthat uses the availableAxonServerConnectionDetailsto specify theAxonServerConfiguration.getServers().
-
topologyChangeListenerConfigurerModule
@Bean @ConditionalOnProperty(name="axon.axonserver.enabled", matchIfMissing=true) public ConfigurationEnhancer topologyChangeListenerConfigurerModule(List<TopologyChangeListener> changeListeners) Bean creation method constructing aConfigurationEnhancerthat uses the availableTopologyChangeListenersand registers them with theAxonServerConnectionManager.- Parameters:
changeListeners- The topology change listeners, if present, to register with this application'sAxonServerConnectionManager.- Returns:
- A
ConfigurationEnhancerthat uses the availableTopologyChangeListenersand registers them with theAxonServerConnectionManager.
-
setApplicationContext
public void setApplicationContext(@Nonnull org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-