public interface LifecycleOperations
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.
LifecycleHandler
,
Phase
Modifier and Type | Method and Description |
---|---|
void |
onShutdown(int phase,
LifecycleHandler shutdownHandler)
Registers an asynchronous
shutdownHandler to be executed in the given phase when the
Configuration is shut down. |
default void |
onShutdown(int phase,
Runnable shutdownHandler)
Registers a
shutdownHandler to be executed in the given phase when the Configuration is shut
down. |
default void |
onShutdown(Runnable shutdownHandler)
Registers a
shutdownHandler to be executed in the default phase 0 when the Configuration is shut
down. |
void |
onStart(int phase,
LifecycleHandler startHandler)
Registers an asynchronous
startHandler to be executed in the given phase when this Configuration
is started. |
default void |
onStart(int phase,
Runnable startHandler)
Registers a
startHandler to be executed in the given phase when this Configuration is started. |
default void |
onStart(Runnable startHandler)
Registers a
startHandler to be executed in the default phase 0 when this Configuration is
started. |
default void onStart(Runnable startHandler)
startHandler
to be executed in the default phase 0
when this Configuration is
started.
The behavior for handlers that are registered when the Configuration is already started is undefined.
startHandler
- the handler to execute when the configuration is startedConfiguration.start()
default void onStart(int phase, Runnable startHandler)
startHandler
to be executed in the given phase
when this Configuration is started.
The behavior for handlers that are registered when the Configuration is already started is undefined.
phase
- defines a phase
in which the start handler will be invoked during Configuration.start()
. When starting the configuration the given handlers are started in
ascending order based on their phase
startHandler
- the handler to execute when the configuration is startedConfiguration.start()
void onStart(int phase, LifecycleHandler startHandler)
startHandler
to be executed in the given phase
when this Configuration
is started.
The behavior for handlers that are registered when the Configuration is already started is undefined.
phase
- defines a phase
in which the start handler will be invoked during Configuration.start()
. When starting the configuration the given handlers are started in
ascending order based on their phase
startHandler
- the handler to be executed asynchronously when the configuration is startedConfiguration.start()
default void onShutdown(Runnable shutdownHandler)
shutdownHandler
to be executed in the default phase 0
when the Configuration is shut
down.
The behavior for handlers that are registered when the Configuration is already shut down is undefined.
shutdownHandler
- the handler to execute when the Configuration is shut downConfiguration.shutdown()
default void onShutdown(int phase, Runnable shutdownHandler)
shutdownHandler
to be executed in the given phase
when the Configuration is shut
down.
The behavior for handlers that are registered when the Configuration is already shut down is undefined.
phase
- defines a phase in which the shutdown handler will be invoked during Configuration.shutdown()
. When shutting down the configuration the given handlers are
executing in descending order based on their phase
shutdownHandler
- the handler to execute when the Configuration is shut downConfiguration.shutdown()
void onShutdown(int phase, LifecycleHandler shutdownHandler)
shutdownHandler
to be executed in the given phase
when the
Configuration is shut down.
The behavior for handlers that are registered when the Configuration is already shut down is undefined.
phase
- defines a phase in which the shutdown handler will be invoked during Configuration.shutdown()
. When shutting down the configuration the given handlers are
executing in descending order based on their phase
shutdownHandler
- the handler to be executed asynchronously when the Configuration is shut downConfiguration.shutdown()
Copyright © 2010–2024. All rights reserved.