Controller - org.jboss.dependency.spi.Controller
The controller is the main state machine that handles contexts and their lifecycle.
Implementations
AbstractController - this is the base implementation of the contract.
KernelController - an extension to the AbstractController that adds the POJO dependency model.
Attributes
List<ControllerState> getStates()
- the states managed by the controller.
Operations
install(ControllerContext)
- adds a context to the controller such that the controller manages the lifecycle.
uninstall(ControllerContext)
- removes a context from the controller.
change(ControllerContext, ControllerState)
- (1) changes the requested state of the context (2).
enableOnDemand(ControllerContext)
- make a context in the On Demand mode move to the Installed final state.
Management
addState(ControllerState newState, ControllerState before)
- add a new state "before" the referenced state, beyond the default states.
Queries
ControllerContext getContext(Object name, ControllerState expected)
retrieve a context in the expected state (3).
ControllerContext.getInstalledContext(Object name)
- equivalent to
getContext(name, ControllerState.INSTALLED)
.
Set<ControllerContext> getNotInstalledContext()
- retrieves a list of contexts not in the final Installed state.
Notes
(1) This method is not required in Automatic mode though it can still be used in such a case.
(2) The change may not take affect if the dependencies of the context for that state are not satisified. When the dependencies are satisfied it will move to that state.
(3) Passing an expected state of "null" is equivalent to any state.
Referenced by:
Comments