Module org.refcodes.component
Package org.refcodes.component
Class LifecycleMachine.ManualLifecycleMachine
java.lang.Object
org.refcodes.component.LifecycleMachine
org.refcodes.component.LifecycleMachine.ManualLifecycleMachine
- All Implemented Interfaces:
Destroyable
,Destroyable.DestroyAutomaton
,Initializable
,Initializable.InitializeAutomaton
,InitializedAccessor
,LifecycleComponent
,LifecycleComponent.LifecycleAutomaton
,LifecycleStatusAccessor
,LifecycleStatusAccessor.LifecycleStatusMutator
,Pausable
,Pausable.PauseAutomaton
,Resumable
,Resumable.ResumeAutomaton
,RunningAccessor
,Startable
,Startable.StartAutomaton
,Stoppable
,Stoppable.StopAutomaton
- Enclosing class:
- LifecycleMachine
public static class LifecycleMachine.ManualLifecycleMachine
extends LifecycleMachine
implements LifecycleStatusAccessor.LifecycleStatusMutator
Opens the otherwise protected
setLifecycleStatus(LifecycleStatus)
to be public in order to
force any lifecycle status to be set.-
Nested Class Summary
Nested classes/interfaces inherited from class org.refcodes.component.LifecycleMachine
LifecycleMachine.ManualLifecycleMachine
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.InitializedAccessor
InitializedAccessor.InitializedMutator, InitializedAccessor.InitializedProperty
Nested classes/interfaces inherited from interface org.refcodes.component.LifecycleComponent
LifecycleComponent.LifecycleAutomaton, LifecycleComponent.UncheckedLifecycleComponent
Nested classes/interfaces inherited from interface org.refcodes.component.LifecycleStatusAccessor
LifecycleStatusAccessor.LifecycleStatusBuilder<B extends LifecycleStatusAccessor.LifecycleStatusBuilder<B>>, LifecycleStatusAccessor.LifecycleStatusMutator, LifecycleStatusAccessor.LifecycleStatusProperty
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.RunningAccessor
RunningAccessor.RunningMutator, RunningAccessor.RunningProperty
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
-
Constructor Summary
ConstructorDescriptionEmpty constructor, suchLifecycleMachine.ManualLifecycleMachine
cannot do much more than decline the variousLifecycleStatus
states for you.ManualLifecycleMachine
(LifecycleComponent aLifecycleComponent) This constructor uses aLifecycleMachine.ManualLifecycleMachine
for wrapping it inside theLifecycleComponent.LifecycleAutomaton
, making sure of obeying and guarding the correctLifecycleStatus
's order ofLifecycleStatus
states for you. -
Method Summary
Modifier and TypeMethodDescriptionvoid
setLifecycleStatus
(LifecycleStatus aStatus) Method to force anyLifecycleStatus
to be set with no rules being applied.Methods inherited from class org.refcodes.component.LifecycleMachine
destroy, getLifecycleComponent, getLifecycleStatus, initialize, isDestroyable, isDestroyed, isInitalizable, isInitialized, isPausable, isPaused, isResumable, isRunning, isStartable, isStoppable, isStopped, pause, resume, start, stop
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.refcodes.component.Initializable
initializeUnchecked
Methods inherited from interface org.refcodes.component.Pausable
pauseUnchecked
Methods inherited from interface org.refcodes.component.Resumable
resumeUnchecked
Methods inherited from interface org.refcodes.component.Startable
startUnchecked
Methods inherited from interface org.refcodes.component.Stoppable
stopUnchecked
-
Constructor Details
-
ManualLifecycleMachine
public ManualLifecycleMachine()Empty constructor, suchLifecycleMachine.ManualLifecycleMachine
cannot do much more than decline the variousLifecycleStatus
states for you. -
ManualLifecycleMachine
This constructor uses aLifecycleMachine.ManualLifecycleMachine
for wrapping it inside theLifecycleComponent.LifecycleAutomaton
, making sure of obeying and guarding the correctLifecycleStatus
's order ofLifecycleStatus
states for you.- Parameters:
aLifecycleComponent
- The component to be guarded regarding the correct declination of theLifecycleStatus
states.
-
-
Method Details
-
setLifecycleStatus
Method to force anyLifecycleStatus
to be set with no rules being applied. Provides means to set theLifecycleStatus
manually.- Specified by:
setLifecycleStatus
in interfaceLifecycleStatusAccessor.LifecycleStatusMutator
- Overrides:
setLifecycleStatus
in classLifecycleMachine
- Parameters:
aStatus
- The status to be "forced".
-