C
- The type of the Component
supported by the
CompositeComponentImpl
.Flushable
, Closable
, CompositeComponent
, Decomposeable
, Destroyable
, Flushable
, Initializable
, LifeCycleComponent
, LinkComponent
, Openable
, Pausable
, Resetable
, Resumable
, Startable
, Stoppable
, org.refcodes.mixin.Disposable
CompositeComponentImpl.ExtendedCompositeComponentImpl
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 C
as generic type argument.Modifier and Type | Class | Description |
---|---|---|
static class |
CompositeComponentImpl.ExtendedCompositeComponentImpl<C extends Component,CTX,CON> |
The
CompositeComponentImpl.ExtendedCompositeComponentImpl is an implementation of the
CompositeComponent.ExtendedCompositeComponent . |
Closable.CloseAutomaton, Closable.CloseBuilder<B extends Closable.CloseBuilder<B>>
CompositeComponent.ExtendedCompositeComponent<CTX,CON>
Decomposeable.DecomposeAutomaton
Destroyable.DestroyAutomaton
org.refcodes.mixin.Disposable.Disposedable
Flushable.FlushBuilder<B extends Flushable.FlushBuilder<B>>
Initializable.InitializeAutomaton, Initializable.InitializeBuilder<B extends Initializable.InitializeBuilder<B>>, Initializable.UncheckedInitializable
LifeCycleComponent.LifeCycleAutomaton, LifeCycleComponent.UncheckedLifeCycleComponent
LinkComponent.LinkAutomaton, LinkComponent.LinkComponentBuilder<B extends LinkComponent.LinkComponentBuilder<B>>
Openable.OpenAutomaton, Openable.OpenBuilder<B extends Openable.OpenBuilder<B>>
Pausable.PauseAutomaton, Pausable.PauseBuilder<B extends Pausable.PauseBuilder<B>>, Pausable.UncheckedPausable
Resumable.ResumeAutomaton, Resumable.ResumeBuilder<B extends Resumable.ResumeBuilder<B>>, Resumable.UncheckedResumable
Startable.StartAutomaton, Startable.StartBuilder<B extends Startable.StartBuilder<B>>, Startable.UncheckedStartable
Stoppable.StopAutomaton, Stoppable.StopBuilder<B extends Stoppable.StopBuilder<B>>, Stoppable.UncheckedStoppable
Constructor | 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 | 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.
|
closeIn, closeQuietly, closeUnchecked
flushUnchecked, isFlushable
initializeUnchecked
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
openUnchecked
pauseUnchecked
resumeUnchecked
startUnchecked
stopUnchecked
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 IOException
flush
in interface Flushable
flush
in interface Flushable
IOException
public void decompose()
decompose
in interface Decomposeable
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 void stop() throws StopException
stop
in interface Stoppable
StopException
- Thrown in case stopping fails.public void resume() throws ResumeException
resume
in interface Resumable
ResumeException
- Thrown in case resuming fails.public void pause() throws PauseException
pause
in interface Pausable
PauseException
- in case pausing fails.public void start() throws StartException
start
in interface Startable
StartException
- Thrown in case starting fails.public void initialize() throws InitializeException
initialize
in interface Initializable
InitializeException
- Thrown in case initializing fails.public void reset()
public void open() throws IOException
open
in interface Openable
IOException
- Thrown in case opening or accessing an open line
(connection, junction, link) caused problems.public void close() throws IOException
IOException
as
upon close we may have to do things like flushing buffers which can fail
(and would otherwise fail unhandled or even worse unnoticed).close
in interface Closable
IOException
- thrown in case closing failed.public void dispose()
dispose
in interface org.refcodes.mixin.Disposable
protected org.refcodes.controlflow.ExecutionStrategy getExecutionStrategy()
ExecutionStrategy
.ExecutionStrategy
being set.Copyright © 2021. All rights reserved.