diff --git a/src/main/java/info/ebenoit/ebul/cmp/ComponentState.java b/src/main/java/info/ebenoit/ebul/cmp/ComponentState.java index 7ae200b..dfaa3af 100644 --- a/src/main/java/info/ebenoit/ebul/cmp/ComponentState.java +++ b/src/main/java/info/ebenoit/ebul/cmp/ComponentState.java @@ -156,9 +156,10 @@ public final class ComponentState throw new IllegalStateException( "registry has failed" ); } this.wasActive = this.active; - if ( this.active ) { + if ( !this.active ) { return null; } + assert this.initialised; for ( final ComponentState rdepState : this.reverseDependencies ) { final Throwable t = rdepState.stop( ); @@ -168,7 +169,7 @@ public final class ComponentState } try { - this.runLifecycleAction( LifecycleStage.START ); + this.runLifecycleAction( LifecycleStage.STOP ); } catch ( final Throwable t ) { return t; } @@ -181,10 +182,6 @@ public final class ComponentState public void restart( ) throws IllegalStateException , ComponentRestartException { - if ( this.registry.hasFailed( ) ) { - throw new IllegalStateException( "registry has failed" ); - } - final Throwable t = this.stop( ); if ( t != null ) { throw new ComponentRestartException( "failed to stop" , t );