CTX
- the context used to initialize the implementing instance.Configurable<CTX>
, Configurable.ConfigureAutomaton<CTX>
, ConfigurableLifeCycleComponent<CTX>
, ConfigurableLifeCycleComponent.ConfigurableLifeCycleAutomaton<CTX>
, Destroyable
, Destroyable.DestroyAutomaton
, InitializedAccessor
, LifeCycleStatusAccessor
, Pausable
, Pausable.PauseAutomaton
, Resumable
, Resumable.ResumeAutomaton
, RunningAccessor
, Startable
, Startable.StartAutomaton
, Stoppable
, Stoppable.StopAutomaton
public class ConfigurableLifeCycleAutomatonImpl<CTX> extends Object implements ConfigurableLifeCycleComponent.ConfigurableLifeCycleAutomaton<CTX>
ConfigurableLifeCycleComponent.ConfigurableLifeCycleAutomaton
.Configurable.ConfigureAutomaton<CTX>, Configurable.ConfigureBuilder<CTX,B extends Configurable.ConfigureBuilder<CTX,B>>
ConfigurableLifeCycleComponent.ConfigurableLifeCycleAutomaton<CTX>
Destroyable.DestroyAutomaton
InitializedAccessor.InitializedMutator, InitializedAccessor.InitializedProperty
LifeCycleStatusAccessor.LifeCycleStatusBuilder<B extends LifeCycleStatusAccessor.LifeCycleStatusBuilder<B>>, LifeCycleStatusAccessor.LifeCycleStatusMutator, LifeCycleStatusAccessor.LifeCycleStatusProperty
Pausable.PauseAutomaton, Pausable.PauseBuilder<B extends Pausable.PauseBuilder<B>>, Pausable.UncheckedPausable
Resumable.ResumeAutomaton, Resumable.ResumeBuilder<B extends Resumable.ResumeBuilder<B>>, Resumable.UncheckedResumable
RunningAccessor.RunningMutator, RunningAccessor.RunningProperty
Startable.StartAutomaton, Startable.StartBuilder<B extends Startable.StartBuilder<B>>, Startable.UncheckedStartable
Stoppable.StopAutomaton, Stoppable.StopBuilder<B extends Stoppable.StopBuilder<B>>, Stoppable.UncheckedStoppable
Constructor | Description |
---|---|
ConfigurableLifeCycleAutomatonImpl() |
Empty constructor, such
LifeCycleComponent.LifeCycleAutomaton cannot do much more
than decline the various LifeCycleStatus states for you. |
ConfigurableLifeCycleAutomatonImpl(ConfigurableLifeCycleComponent<CTX> aLifeConfigurableCycleComponent) |
This constructor uses a
LifeCycleStatus for wrapping it inside
the ConfigurableLifeCycleAutomatonImpl , making sure of obeying
and guarding the correct LifeCycleStatus 's order of
LifeCycleStatus states for you. |
Modifier and Type | Method | Description |
---|---|---|
void |
destroy() |
Destroys the component.
|
protected ConfigurableLifeCycleComponent<CTX> |
getLifeCycleComponent() |
Provides access to the
LifeCycleComponent instance. |
LifeCycleStatus |
getLifeCycleStatus() |
Retrieves the
LifeCycleStatus property from the property. |
void |
initialize(CTX aContext) |
Initializes and configures the component.
|
boolean |
isDestroyable() |
Determines whether the component may get destroyed.
|
boolean |
isDestroyed() |
Determines whether the component is destroyed.
|
boolean |
isInitalizable(CTX aContext) |
Checks if is initalizable.
|
boolean |
isInitialized() |
Retrieves the is-initialized property from the initialized property.
|
boolean |
isPausable() |
Determines whether the component may get paused.
|
boolean |
isPaused() |
Determines whether the component is paused.
|
boolean |
isResumable() |
Determines whether the component may get resumed.
|
boolean |
isRunning() |
Retrieves the is-running property from the running property.
|
boolean |
isStartable() |
Determines whether the component may get started.
|
boolean |
isStoppable() |
Determines whether the component may get stopped.
|
boolean |
isStopped() |
Determines whether the component is stopped.
|
void |
pause() |
Pauses the component.
|
void |
resume() |
Resumes the component.
|
void |
start() |
Starts the component.
|
void |
stop() |
Stops the component.
|
initializeUnchecked
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
pauseUnchecked
resumeUnchecked
startUnchecked
stopUnchecked
public ConfigurableLifeCycleAutomatonImpl()
LifeCycleComponent.LifeCycleAutomaton
cannot do much more
than decline the various LifeCycleStatus
states for you.public ConfigurableLifeCycleAutomatonImpl(ConfigurableLifeCycleComponent<CTX> aLifeConfigurableCycleComponent)
LifeCycleStatus
for wrapping it inside
the ConfigurableLifeCycleAutomatonImpl
, making sure of obeying
and guarding the correct LifeCycleStatus
's order of
LifeCycleStatus
states for you.aLifeConfigurableCycleComponent
- The component to be guarded
regarding the correct declination of the LifeCycleStatus
states.public LifeCycleStatus getLifeCycleStatus()
LifeCycleStatus
property from the property.
Determines in which LifeCycleStatus
status a component is in.getLifeCycleStatus
in interface LifeCycleStatusAccessor
LifeCycleStatus
property stored by the
property.public void initialize(CTX aContext) throws InitializeException
initialize
in interface Configurable<CTX>
aContext
- The context to be passed to the implementing instance.InitializeException
- Thrown in case initializing fails.public boolean isInitalizable(CTX aContext)
isInitalizable
in interface Configurable.ConfigureAutomaton<CTX>
aContext
- the contextpublic boolean isInitialized()
Initializable.initialize()
or
Configurable.initialize(Object)
.isInitialized
in interface InitializedAccessor
public boolean isStartable()
isStartable
in interface Startable.StartAutomaton
Startable.start()
is possible.public void start() throws StartException
start
in interface Startable
StartException
- Thrown in case starting fails.public boolean isRunning()
Startable.start()
or
Resumable.resume()
.isRunning
in interface RunningAccessor
public boolean isPausable()
isPausable
in interface Pausable.PauseAutomaton
Pausable.pause()
is possible.public void pause() throws PauseException
pause
in interface Pausable
PauseException
- in case pausing fails.public boolean isPaused()
isPaused
in interface Pausable.PauseAutomaton
public boolean isResumable()
isResumable
in interface Resumable.ResumeAutomaton
Resumable.resume()
is possible.public void resume() throws ResumeException
resume
in interface Resumable
ResumeException
- Thrown in case resuming fails.public boolean isStoppable()
isStoppable
in interface Stoppable.StopAutomaton
Stoppable.stop()
is possible.public void stop() throws StopException
stop
in interface Stoppable
StopException
- Thrown in case stopping fails.public boolean isStopped()
isStopped
in interface Stoppable.StopAutomaton
public boolean isDestroyable()
isDestroyable
in interface Destroyable.DestroyAutomaton
Destroyable.destroy()
is possible.public void destroy()
Component
has been destroyed, then invoking any of that
Component
instance's methods (except the Destroyable.destroy()
method) must throw an IllegalStateException
as by definition a
once destroyed Component
is in the state of being destroyed which
is irreversible.destroy
in interface Destroyable
public boolean isDestroyed()
Component
instance's methods
(except the Destroyable.destroy()
method) must throw an
IllegalStateException
as by definition a once destroyed
Component
is in the state of being destroyed which is
irreversible.isDestroyed
in interface Destroyable.DestroyAutomaton
protected ConfigurableLifeCycleComponent<CTX> getLifeCycleComponent()
LifeCycleComponent
instance.LifeCycleComponent
instance being set.Copyright © 2018. All rights reserved.