public abstract class ComponentStateImp extends java.lang.Object implements ComponentState
Default implementation of ComponentState
. Each default method
implementation does nothing other than request the same operation on any
StateManagedComponent
s which are sub-components of
comp
. This is required if for example an Adapter is started and
one of its Channels is stopped. requestStart
has nothing to do
at the Adapter level but must still be propogated to the stopped Channel
which does require manipulation.
Modifier and Type | Field and Description |
---|---|
protected org.slf4j.Logger |
log |
Constructor and Description |
---|
ComponentStateImp() |
Modifier and Type | Method and Description |
---|---|
void |
requestClose(StateManagedComponent comp)
Perform operations required to move
comp from this
state to ClosedState , if possible. |
void |
requestInit(StateManagedComponent comp)
Perform operations required to move
comp from this
state to InitialisedState , if possible. |
void |
requestRestart(StateManagedComponent comp)
Perform operations required to restart the
comp . |
void |
requestStart(StateManagedComponent comp)
Perform operations required to move
comp from this
state to StartedState , if possible. |
void |
requestStop(StateManagedComponent comp)
Perform operations required to move
comp from this
state to StoppedState , if possible. |
java.lang.String |
toString() |
public void requestInit(StateManagedComponent comp) throws CoreException
ComponentState
Perform operations required to move comp
from this
state to InitialisedState
, if possible.
requestInit
in interface ComponentState
comp
- the StateManagedComponent
to manipulateCoreException
- wrapping any underlying exceptions(com.adaptris.core.StateManagedComponent)
public void requestStart(StateManagedComponent comp) throws CoreException
ComponentState
Perform operations required to move comp
from this
state to StartedState
, if possible.
requestStart
in interface ComponentState
comp
- the StateManagedComponent
to manipulateCoreException
- wrapping any underlying exceptions(com.adaptris.core.StateManagedComponent)
public void requestStop(StateManagedComponent comp)
ComponentState
Perform operations required to move comp
from this
state to StoppedState
, if possible.
requestStop
in interface ComponentState
comp
- the StateManagedComponent
to manipulate(com.adaptris.core.StateManagedComponent)
public void requestClose(StateManagedComponent comp)
ComponentState
Perform operations required to move comp
from this
state to ClosedState
, if possible.
requestClose
in interface ComponentState
comp
- the StateManagedComponent
to manipulate(com.adaptris.core.StateManagedComponent)
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public void requestRestart(StateManagedComponent comp) throws CoreException
ComponentState
Perform operations required to restart the comp
. Differs
from start in that underlying components which are in the
StartedState
will be stopped, closed, inited and started.
requestRestart
in interface ComponentState
comp
- the StateManagedComponent
to manipulateCoreException
- wrapping any underlying exceptionsComponentState.requestRestart(com.adaptris.core.StateManagedComponent)