Package org.commonjava.indy.action
Class IndyLifecycleManager
- java.lang.Object
-
- org.commonjava.indy.action.IndyLifecycleManager
-
@ApplicationScoped public class IndyLifecycleManager extends Object
Handles the startup sequence (managingBootupAction,MigrationAction, andStartupActioninstances in order), and the shutdown sequence (managingShutdownActioninstances in order.- Author:
- jdcasey
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedIndyLifecycleManager()IndyLifecycleManager(org.commonjava.indy.stats.IndyVersioning versioning, Iterable<BootupAction> bootupActionInstances, Iterable<MigrationAction> migrationActionInstances, Iterable<StartupAction> startupActionInstances, Iterable<ShutdownAction> shutdownActionInstances)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RunnablecreateShutdownRunnable()Create a Runnable that can be used inRuntime.addShutdownHook(Thread).voidinit()voidstart()Start sequence is: Start allBootupActioninstances, with highest priority executing first. Run allMigrationActioninstances, with highest priority executing first. Run allStartupActioninstances, with highest priority executing first.voidstop()Run allShutdownActioninstances, with highest priority executing first.
-
-
-
Constructor Detail
-
IndyLifecycleManager
protected IndyLifecycleManager()
-
IndyLifecycleManager
public IndyLifecycleManager(org.commonjava.indy.stats.IndyVersioning versioning, Iterable<BootupAction> bootupActionInstances, Iterable<MigrationAction> migrationActionInstances, Iterable<StartupAction> startupActionInstances, Iterable<ShutdownAction> shutdownActionInstances)
-
-
Method Detail
-
init
@PostConstruct public void init()
-
start
public void start() throws IndyLifecycleExceptionStart sequence is:- Start all
BootupActioninstances, with highest priority executing first. - Run all
MigrationActioninstances, with highest priority executing first. - Run all
StartupActioninstances, with highest priority executing first.
- Throws:
IndyLifecycleException
- Start all
-
stop
public void stop() throws IndyLifecycleExceptionRun allShutdownActioninstances, with highest priority executing first.- Throws:
IndyLifecycleException
-
createShutdownRunnable
public Runnable createShutdownRunnable()
Create a Runnable that can be used inRuntime.addShutdownHook(Thread).
-
-