C
- The type of the Component
supported by the
CompositeComponentImpl
.public class CompositeComponentImpl<C extends Component> extends Object implements CompositeComponent
CompositeComponentImpl
is an implementation of the
CompositeComponent
. To make sure that the state change requests you
require are supported by the managed Component
instances, specify the
according type Modifier and Type | Class and Description |
---|---|
static class |
CompositeComponentImpl.ExtendedCompositeComponentImpl<C extends Component,CTX,CON>
The
CompositeComponentImpl.ExtendedCompositeComponentImpl is an implementation of the
ExtendedCompositeComponent . |
CompositeComponent.ExtendedCompositeComponent<CTX,CON>
LifeCycleComponent.LifeCycleAutomaton, LifeCycleComponent.UncheckedLifeCycleComponent
Initializable.InitializeAutomaton, Initializable.InitializeBuilder<B extends Initializable.InitializeBuilder<B>>, Initializable.UncheckedInitializable
Startable.StartAutomaton, Startable.StartBuilder<B extends Startable.StartBuilder<B>>, Startable.UncheckedStartable
Pausable.PauseAutomaton, Pausable.PauseBuilder<B extends Pausable.PauseBuilder<B>>, Pausable.UncheckedPausable
Resumable.ResumeAutomaton, Resumable.ResumeBuilder<B extends Resumable.ResumeBuilder<B>>, Resumable.UncheckedResumable
Stoppable.StopAutomaton, Stoppable.StopBuilder<B extends Stoppable.StopBuilder<B>>, Stoppable.UncheckedStoppable
Destroyable.DestroyAutomaton
DeviceComponent.DeviceAutomaton
Openable.OpenAutomaton
Closable.CloseAutomaton
Decomposeable.DecomposeAutomaton
Constructor and Description |
---|
CompositeComponentImpl(C... aComponents)
Creates a
CompositeComponentImpl containing the provided
components. |
CompositeComponentImpl(Collection<C> aComponents)
Creates a
CompositeComponentImpl containing the provided
components. |
CompositeComponentImpl(org.refcodes.controlflow.ExecutionStrategy aStrategy,
C... aComponents)
Creates a
CompositeComponentImpl containing the provided
components. |
CompositeComponentImpl(org.refcodes.controlflow.ExecutionStrategy aStrategy,
Collection<C> aComponents)
Creates a
CompositeComponentImpl containing the provided
components. |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the component's connection(s).
|
void |
decompose()
Decomposes the component.
|
void |
destroy()
Destroys the component.
|
void |
dispose() |
void |
flush() |
protected Set<C> |
getComponents()
Provides access to the
Component instances. |
protected org.refcodes.controlflow.ExecutionStrategy |
getExecutionStrategy()
Provides access to the
ExecutionStrategy . |
void |
initialize()
Initialize the component.
|
void |
open()
Open the component's connection(s).
|
void |
pause()
Pauses the component.
|
void |
reset()
Resets the component.
|
void |
resume()
Resumes the component.
|
void |
start()
Starts the component.
|
void |
stop()
Stops the component.
|
public CompositeComponentImpl(Collection<C> aComponents)
CompositeComponentImpl
containing the provided
components. The ExecutionStrategy.JOIN
ExecutionStrategy
is used by default.aComponents
- The components to be managed by the
CompositeComponentImpl
.public CompositeComponentImpl(org.refcodes.controlflow.ExecutionStrategy aStrategy, Collection<C> aComponents)
CompositeComponentImpl
containing the provided
components.aStrategy
- The ExecutionStrategy
for executing the state
change requests.aComponents
- The components to be managed by the
CompositeComponentImpl
.@SafeVarargs public CompositeComponentImpl(C... aComponents)
CompositeComponentImpl
containing the provided
components. The ExecutionStrategy.JOIN
ExecutionStrategy
is used by default.aComponents
- The components to be managed by the
CompositeComponentImpl
.@SafeVarargs public CompositeComponentImpl(org.refcodes.controlflow.ExecutionStrategy aStrategy, C... aComponents)
CompositeComponentImpl
containing the provided
components.aStrategy
- The ExecutionStrategy
for executing the state
change requests.aComponents
- The components to be managed by the
CompositeComponentImpl
.public void flush() throws OpenException
flush
in interface Flushable
OpenException
public void decompose()
Decomposeable
decompose
in interface Decomposeable
public void destroy()
Destroyable
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 void stop() throws StopException
Stoppable
stop
in interface Stoppable
StopException
- Thrown in case stopping fails.public void resume() throws ResumeException
Resumable
resume
in interface Resumable
ResumeException
- Thrown in case resuming fails.public void pause() throws PauseException
Pausable
pause
in interface Pausable
PauseException
- in case pausing fails.public void start() throws StartException
Startable
start
in interface Startable
StartException
- Thrown in case starting fails.public void initialize() throws InitializeException
Initializable
initialize
in interface Initializable
InitializeException
- Thrown in case initializing fails.public void reset()
Resetable
public void open() throws OpenException
Openable
open
in interface Openable
OpenException
- Thrown in case opening or accessing an open line
(connection, junction, link) caused problems.public void close()
Closable
CloseException
as
upon close we may have to do things like flushing buffers which can fail
(and would otherwise fail unhandled or even worse unnoticed).public void dispose()
dispose
in interface org.refcodes.mixin.Disposable
protected org.refcodes.controlflow.ExecutionStrategy getExecutionStrategy()
ExecutionStrategy
.ExecutionStrategy
being set.Copyright © 2016. All rights reserved.