Interface LifecycleOperations
- All Known Subinterfaces:
Configuration,Configurer
- All Known Implementing Classes:
AxonConfiguration,DefaultConfigurer,SpringConfigurer
Both Runnables or LifecycleHandlers can be configured. The invocation order
is defined through the (optional) phase parameter. The Phase enumeration
may be used as a guidance to add operations before/after Axon's regular steps.
- Since:
- 4.6.0
- Author:
- Steven van Beelen
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidonShutdown(int phase, Runnable shutdownHandler) Registers ashutdownHandlerto be executed in the givenphasewhen the Configuration is shut down.voidonShutdown(int phase, LifecycleHandler shutdownHandler) Registers an asynchronousshutdownHandlerto be executed in the givenphasewhen the Configuration is shut down.default voidonShutdown(Runnable shutdownHandler) Registers ashutdownHandlerto be executed in the default phase0when the Configuration is shut down.default voidRegisters astartHandlerto be executed in the givenphasewhen this Configuration is started.voidonStart(int phase, LifecycleHandler startHandler) Registers an asynchronousstartHandlerto be executed in the givenphasewhen this Configuration is started.default voidRegisters astartHandlerto be executed in the default phase0when this Configuration is started.
-
Method Details
-
onStart
Registers astartHandlerto be executed in the default phase0when this Configuration is started.The behavior for handlers that are registered when the Configuration is already started is undefined.
- Parameters:
startHandler- the handler to execute when the configuration is started- See Also:
-
onStart
Registers astartHandlerto be executed in the givenphasewhen this Configuration is started.The behavior for handlers that are registered when the Configuration is already started is undefined.
- Parameters:
phase- defines aphasein which the start handler will be invoked duringConfiguration.start(). When starting the configuration the given handlers are started in ascending order based on theirphasestartHandler- the handler to execute when the configuration is started- See Also:
-
onStart
Registers an asynchronousstartHandlerto be executed in the givenphasewhen this Configuration is started.The behavior for handlers that are registered when the Configuration is already started is undefined.
- Parameters:
phase- defines aphasein which the start handler will be invoked duringConfiguration.start(). When starting the configuration the given handlers are started in ascending order based on theirphasestartHandler- the handler to be executed asynchronously when the configuration is started- See Also:
-
onShutdown
Registers ashutdownHandlerto be executed in the default phase0when the Configuration is shut down.The behavior for handlers that are registered when the Configuration is already shut down is undefined.
- Parameters:
shutdownHandler- the handler to execute when the Configuration is shut down- See Also:
-
onShutdown
Registers ashutdownHandlerto be executed in the givenphasewhen the Configuration is shut down.The behavior for handlers that are registered when the Configuration is already shut down is undefined.
- Parameters:
phase- defines a phase in which the shutdown handler will be invoked duringConfiguration.shutdown(). When shutting down the configuration the given handlers are executing in descending order based on theirphaseshutdownHandler- the handler to execute when the Configuration is shut down- See Also:
-
onShutdown
Registers an asynchronousshutdownHandlerto be executed in the givenphasewhen the Configuration is shut down.The behavior for handlers that are registered when the Configuration is already shut down is undefined.
- Parameters:
phase- defines a phase in which the shutdown handler will be invoked duringConfiguration.shutdown(). When shutting down the configuration the given handlers are executing in descending order based on theirphaseshutdownHandler- the handler to be executed asynchronously when the Configuration is shut down- See Also:
-