Component state - Fixed various bugs in stop()
* Stopping only if inactive... * Calling the wrong lifecycle action...
This commit is contained in:
parent
2fa4227e5a
commit
618204b8b1
1 changed files with 3 additions and 6 deletions
|
@ -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 );
|
||||
|
|
Loading…
Reference in a new issue