public interface HasLifecycle
ComponentLookup during this phase.
- init: in which components are initialized. Components can expect to have
been set in a safe configuration and hardware can now be initialized
and connections to the devices can be opened
- start: the subsystem has just joined the buses. Any status publication
can happen at this point
- shutdown: the subsystem is shutting down. All hardware connections should
be terminated at this point.
There are two methods for each phase: phase() and postPhase(). The phase() method
is invoked while traversing the ComponentLookup tree going up, from parent
to children, while the postPhast() method is invoked traversing the ComponentLookup tree
going down, once it has been invoked on all the children.
So the following rules apply:
- the phase() method is invoked on a node after it has been invoked on its
parent and before it is invoked on any of its children
- the postPhase() method is invoked on a node after it has been invoked on
all its children and before it is invoked on its parent.
- the order in which these methods are invoked among nodes at the same level
(siblings) depends on the order in which the nodes were added to the
ComponentLookup tree.| Modifier and Type | Method and Description |
|---|---|
default void |
build()
First lifecycle hook.
|
default void |
init()
Called from the enclosing
Subsystem at initialization
phase. |
default void |
postBuild()
First lifecycle hook.
|
default void |
postInit()
Called from the enclosing
Subsystem at construction
phase. |
default void |
postShutdown()
Called from the enclosing
Subsystem when
org.lsst.ccs.Subsystem#shutdown() has been called after shtudownNow has
been invoked on all the children. |
default void |
postStart()
Called from the enclosing
Subsystem. |
default void |
shutdown()
Called from the enclosing
Subsystem when
org.lsst.ccs.Subsystem#shutdown() has been called. |
default void |
start()
Called from the enclosing
Subsystem when
Agent.startAgent() has been called and
after HardwareController components have been handled. |
default void build()
default void postBuild()
default void init()
Subsystem at initialization
phase.
This method is called before the children components of this
object have their init method called.
At the time it is called, connection to the messaging layer is not yet
done, so there should be no attempt to send messages in the body of
this method. Configuration for message listening can nevertheless be
done here, such as adding MessageListener
objects.
It is unnecessary to call super.init()
default void postInit()
Subsystem at construction
phase. This method is called after init and postInit have
been called on this component's children.default void start()
Subsystem when
Agent.startAgent() has been called and
after HardwareController components have been handled.
At the time it is called :
PhaseState is
INITIALIZING
connection with the messaging layer is effective, the enclosing
subsystem has started StatusHeartBeat
publication
the startup configuration has been loaded (if provided). IMPORTANT
NOTE : This statement will not be true in future releases. Code that
expect the startup configuration to be loaded should be moved from
start to postStart.
super.start()default void postStart()
Subsystem.
At the time it is called :
HardwareController components have been handled without
throwing HardwareException
If successful, the enclosing subsystem's
PhaseState will change to
OPERATIONAL and the subsystem will invoke
startTicking on its modules components.
If an HardwareException is thrown, the
OperationalState will change to
ENGINEERING_FAULT until a call to
completeInitialization
is successful
It is unnecessary to call super.postStart()
default void shutdown()
Subsystem when
org.lsst.ccs.Subsystem#shutdown() has been called. At the time it
is called :
PhaseState is CLOSING.
org.lsst.ccs.framework.HardwareController#checkStopped() has
been called
default void postShutdown()
Subsystem when
org.lsst.ccs.Subsystem#shutdown() has been called after shtudownNow has
been invoked on all the children. At the time it
is called :
PhaseState is CLOSING.
org.lsst.ccs.framework.HardwareController#checkStopped() has
been called
Copyright © 2022 LSST. All rights reserved.