Package org.refcodes.component
Interface LifeCycleComponent
-
- All Superinterfaces:
Destroyable
,Initializable
,Pausable
,Resumable
,Startable
,Stoppable
- All Known Subinterfaces:
CompositeComponent
,CompositeComponent.ExtendedCompositeComponent<CTX,CON>
,LifeCycleComponent.LifeCycleAutomaton
,LifeCycleComponent.UncheckedLifeCycleComponent
- All Known Implementing Classes:
CompositeComponentImpl
,CompositeComponentImpl.ExtendedCompositeComponentImpl
,LifeCycleAutomatonImpl
,LifeCycleAutomatonImpl.ManualLifeCycleAutomatonImpl
public interface LifeCycleComponent extends Initializable, Startable, Pausable, Resumable, Stoppable, Destroyable
A component implementing theLifeCycleComponent
interface supports a life-cycle. I.e. such a component may be instructed from the outside to run through several stages from getting started till being destroyed. The valid state changes are mainly as follows: "initialize" - "start" - "pause" - "resume" - "stop" - "destroy" For example: "initialize" - "start" - "pause" - "resume" - "pause" - "resume" - "stop" - "start" - "pause" - "resume" - "stop" - "destroy" TheLifeCycleComponentHandle.LifeCycleAutomatonHandle
is a component managing variousLifeCycleComponent
s each identified by a dedicated handle. Operations on theLifeCycleComponent
are invoked by thisLifeCycleComponentHandle.LifeCycleAutomatonHandle
with a handle identifying the accordingLifeCycleComponent
.The
LifeCycleComponent
contains the business-logic where as theLifeCycleComponentHandle.LifeCycleAutomatonHandle
provides the frame for managing this business-logic. TheLifeCycleComponent.LifeCycleAutomaton
takes care of the correct life-cycle applied on aLifeCycleComponent
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
LifeCycleComponent.LifeCycleAutomaton
A system implementing theLifeCycleComponent.LifeCycleAutomaton
interface supports managingLifeCycleComponent
instances and takes care that the life-cycle stages are invoked in the correct order by throwing according exceptions in case the life-cycle is invoked in the wrong order.static interface
LifeCycleComponent.UncheckedLifeCycleComponent
Same as theLifeCycleComponent
though without the need to try-catch any exceptions on the various life-cycle stages.-
Nested classes/interfaces inherited from interface org.refcodes.component.Destroyable
Destroyable.DestroyAutomaton
-
Nested classes/interfaces inherited from interface org.refcodes.component.Initializable
Initializable.InitializeAutomaton, Initializable.InitializeBuilder<B extends Initializable.InitializeBuilder<B>>, Initializable.UncheckedInitializable
-
Nested classes/interfaces inherited from interface org.refcodes.component.Pausable
Pausable.PauseAutomaton, Pausable.PauseBuilder<B extends Pausable.PauseBuilder<B>>, Pausable.UncheckedPausable
-
Nested classes/interfaces inherited from interface org.refcodes.component.Resumable
Resumable.ResumeAutomaton, Resumable.ResumeBuilder<B extends Resumable.ResumeBuilder<B>>, Resumable.UncheckedResumable
-
Nested classes/interfaces inherited from interface org.refcodes.component.Startable
Startable.StartAutomaton, Startable.StartBuilder<B extends Startable.StartBuilder<B>>, Startable.UncheckedStartable
-
Nested classes/interfaces inherited from interface org.refcodes.component.Stoppable
Stoppable.StopAutomaton, Stoppable.StopBuilder<B extends Stoppable.StopBuilder<B>>, Stoppable.UncheckedStoppable
-
-
Method Summary
-
Methods inherited from interface org.refcodes.component.Destroyable
destroy
-
Methods inherited from interface org.refcodes.component.Initializable
initialize, initializeUnchecked
-
Methods inherited from interface org.refcodes.component.Pausable
pause, pauseUnchecked
-
Methods inherited from interface org.refcodes.component.Resumable
resume, resumeUnchecked
-
Methods inherited from interface org.refcodes.component.Startable
start, startUnchecked
-
Methods inherited from interface org.refcodes.component.Stoppable
stop, stopUnchecked
-
-