diff --git a/src/main/java/info/ebenoit/ebul/cmp/LifecycleStage.java b/src/main/java/info/ebenoit/ebul/cmp/LifecycleStage.java index 8e9ffd2..430d7d9 100644 --- a/src/main/java/info/ebenoit/ebul/cmp/LifecycleStage.java +++ b/src/main/java/info/ebenoit/ebul/cmp/LifecycleStage.java @@ -9,12 +9,27 @@ package info.ebenoit.ebul.cmp; public enum LifecycleStage { /** Initialisation stage */ - INITIALISE , + INITIALISE( ComponentInitialisationException.class ) , /** Startup stage */ - START , + START( ComponentStartupException.class ) , /** Shutdown stage */ - STOP , + STOP( ComponentShutdownException.class ) , /** Destruction stage */ - DESTROY + DESTROY( ComponentDestructionException.class ); + + /** The type of exceptions thrown by this lifecycle stage action */ + public final Class< ? extends ComponentLifecycleException > exceptionType; + + + /** + * Sets the type of exceptions for the lifecycle stage + * + * @param exceptionType + * the type of exceptions + */ + private LifecycleStage( Class< ? extends ComponentLifecycleException > exceptionType ) + { + this.exceptionType = exceptionType; + } }