Package org.axonframework.spring.config
Class SpringAxonConfiguration
java.lang.Object
org.axonframework.spring.config.SpringAxonConfiguration
- All Implemented Interfaces:
org.springframework.beans.factory.FactoryBean<Configuration>,org.springframework.context.Lifecycle,org.springframework.context.Phased,org.springframework.context.SmartLifecycle
public class SpringAxonConfiguration
extends Object
implements org.springframework.beans.factory.FactoryBean<Configuration>, org.springframework.context.SmartLifecycle
Factory Bean implementation that creates an Axon
Configuration for a Configurer. This allows a
Configuration bean to be available in an Application Context that already defines a Configurer.
This factory bean will also ensure the Configuration's lifecycle is attached to the Spring Application
lifecycle.
- Since:
- 4.6.0
- Author:
- Allard Buijze
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intTheSmartLifecycle.getPhase()value of this is set to be safely lower than the typical values listed in the Spring WebServer lifecycles.Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTEFields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
ConstructorsConstructorDescriptionSpringAxonConfiguration(Configurer configurer) Initialize thisConfigurationinstance. -
Method Summary
Modifier and TypeMethodDescriptionClass<?> intgetPhase()booleanvoidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidstart()voidstop()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.beans.factory.FactoryBean
isSingletonMethods inherited from interface org.springframework.context.SmartLifecycle
isAutoStartup, stop
-
Field Details
-
LIFECYCLE_PHASE
public static final int LIFECYCLE_PHASETheSmartLifecycle.getPhase()value of this is set to be safely lower than the typical values listed in the Spring WebServer lifecycles. This means we make sure that: - Axon is ready when the web server starts - The web server is stopped before tearing down Axon- See Also:
-
-
Constructor Details
-
SpringAxonConfiguration
Initialize thisConfigurationinstance.- Parameters:
configurer- The configurer to get theConfigurationfrom.
-
-
Method Details
-
getObject
- Specified by:
getObjectin interfaceorg.springframework.beans.factory.FactoryBean<Configuration>
-
getObjectType
- Specified by:
getObjectTypein interfaceorg.springframework.beans.factory.FactoryBean<Configuration>
-
start
public void start()- Specified by:
startin interfaceorg.springframework.context.Lifecycle
-
stop
public void stop()- Specified by:
stopin interfaceorg.springframework.context.Lifecycle
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceorg.springframework.context.Lifecycle
-
setApplicationContext
@Autowired public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) -
getPhase
public int getPhase()- Specified by:
getPhasein interfaceorg.springframework.context.Phased- Specified by:
getPhasein interfaceorg.springframework.context.SmartLifecycle
-