

Classes | |
| class | DefaultResourceErrorHandler< T > |
| class | StateChangeNotificationChecker |
Public Member Functions | |
| void | initialize (ContainerServices containerServices) throws ComponentLifecycleException |
| void | cleanUp () |
| final ROstringSeq | currentStateHierarchy () |
| final synchronized void | doTransition (SubsystemStateEvent event) throws IllegalStateEventEx |
| void | stateChangedNotify (AcsState[] oldStateHierarchy, AcsState[] currentStateHierarchy) |
| void | updateStateHierarchy () throws AcsJException |
Protected Member Functions | |
| abstract AlmaSubsystemActions | getActionHandler () |
| final void | monitorComponent (ACSComponent component) |
| final< T extends ACSComponent > void | monitorComponent (T component, SubsysResourceMonitor.ResourceErrorHandler< T > err) |
| final void | monitorPingableResource (PingableResourceOperations resource, String name) |
| final< T extends PingableResourceOperations > void | monitorPingableResource (T resource, String name, SubsysResourceMonitor.ResourceErrorHandler< T > err) |
| final< T > void | monitorResource (SubsysResourceMonitor.ResourceChecker< T > checker, SubsysResourceMonitor.ResourceErrorHandler< T > err, int monitorDelaySeconds) |
| final void | stopMonitoringResource (String resourceName) |
| final void | stopMonitoringAllResources () |
Static Package Functions | |
| static String | event2Name (SubsystemStateEvent event) |
Private Attributes | |
| ROstringSeq | m_currentStateHierarchy |
| DataAccess | m_currentStateHierarchyDataAccess |
| AlmaSubsystemContext | m_stateMachine |
| SubsysResourceMonitor | subsysComponentMonitor |
| StateChangeNotificationChecker | stateChangeNotificationChecker |
Base class for subsystem master components.
Each ALMA subsystem ('subsystem' in its technical meaning) must provide such a master component for administrational purposes. It's strongly recommended to do this in Java and use MasterComponentImplBase as the base class for the component implementation.
This class provides the transition logic for the various states. Subclasses only need to implement the actions for the various transitions or, more accurately, for the activity states. (see method getActionHandler; as an example, please see TestMasterComponent.
| void alma::ACS::MasterComponentImpl::MasterComponentImplBase::cleanUp | ( | ) | [inline] |
Master component subclasses must call super.cleanUp() if they override this method!
Reimplemented from alma::ACS::impl::CharacteristicComponentImpl.
References alma::ACS::MasterComponentImpl::statemachine::AlmaSubsystemContext::cleanUp(), alma::ACS::MasterComponentImpl::SubsysResourceMonitor::destroy(), alma::ACS::MasterComponentImpl::StateChangeListener::destroyMonitor(), alma::acs::component::ComponentImplBase::m_logger, m_stateMachine, stateChangeNotificationChecker, and subsysComponentMonitor.
| final ROstringSeq alma::ACS::MasterComponentImpl::MasterComponentImplBase::currentStateHierarchy | ( | ) | [inline] |
| final synchronized void alma::ACS::MasterComponentImpl::MasterComponentImplBase::doTransition | ( | SubsystemStateEvent | event | ) | throws IllegalStateEventEx [inline] |
Dispatches the event to the corresponding state machine method.
Relies on CORBA to queue concurrent calls, which this synchronized implementation forcefully serializes. Note that calls should always return quickly, since the real work is done asynchronously in activity states.
References alma::ACS::MasterComponentImpl::statemachine::AlmaSubsystemContext::error(), event2Name(), alma::ACSErrTypeCommon::wrappers::AcsJIllegalStateEventEx::getEvent(), alma::ACSErrTypeCommon::wrappers::AcsJIllegalStateEventEx::getState(), alma::ACS::MasterComponentImpl::statemachine::AlmaSubsystemContext::initPass1(), alma::ACS::MasterComponentImpl::statemachine::AlmaSubsystemContext::initPass2(), alma::acs::component::ComponentImplBase::m_logger, m_stateMachine, alma::ACS::MasterComponentImpl::statemachine::AlmaSubsystemContext::reinit(), alma::ACSErrTypeCommon::wrappers::AcsJIllegalStateEventEx::setEvent(), alma::ACS::MasterComponentImpl::statemachine::AlmaSubsystemContext::shutdownPass1(), alma::ACS::MasterComponentImpl::statemachine::AlmaSubsystemContext::shutdownPass2(), alma::ACS::MasterComponentImpl::statemachine::AlmaSubsystemContext::start(), alma::ACS::MasterComponentImpl::statemachine::AlmaSubsystemContext::stop(), and alma::ACSErrTypeCommon::wrappers::AcsJIllegalStateEventEx::toIllegalStateEventEx().
Referenced by alma::ACS::MasterComponentImpl::MasterComponentImplBase::DefaultResourceErrorHandler< T >::badState(), and alma::ACS::MasterComponentImpl::MasterComponentImplBase::DefaultResourceErrorHandler< T >::resourceUnreachable().
| static String alma::ACS::MasterComponentImpl::MasterComponentImplBase::event2Name | ( | SubsystemStateEvent | event | ) | [inline, static, package] |
Returns an "inofficial" string version of a SubsystemStateEvent. This can be used for logging etc. Note that in IDL, the enum does not define a string representation.
| event | a subsystem state event as declared in IDL |
null if the event is unknown. References alma::ACS::MasterComponentPackage::SubsystemStateEvent::value.
Referenced by doTransition().
| abstract AlmaSubsystemActions alma::ACS::MasterComponentImpl::MasterComponentImplBase::getActionHandler | ( | ) | [protected, pure virtual] |
Subsystem state machine actions, to be implemented by concrete subclasses.
Implemented in alma::ACS::MasterComponentImpl::TestMasterComponentImpl, and alma::ACS::SpecialTestMasterComponentImpl::SpecialTestMasterComponentImpl.
Referenced by initialize().
| void alma::ACS::MasterComponentImpl::MasterComponentImplBase::initialize | ( | ContainerServices | containerServices | ) | throws ComponentLifecycleException [inline] |
Master component subclasses must call super.initialize() if they override this method!
Reimplemented from alma::ACS::impl::CharacteristicComponentImpl.
Reimplemented in alma::ACS::SpecialTestMasterComponentImpl::SpecialTestMasterComponentImpl.
References alma::ACS::MasterComponentImpl::statemachine::AlmaSubsystemContext::addAcsStateChangeListener(), alma::ACS::MasterComponentImpl::StateChangeListener::createMonitor(), getActionHandler(), alma::ACS::impl::CommonPropertyImpl::getDataAccess(), alma::acs::container::ContainerServicesBase::getThreadFactory(), alma::acs::component::ComponentImplBase::m_containerServices, m_currentStateHierarchy, m_currentStateHierarchyDataAccess, alma::acs::component::ComponentImplBase::m_logger, m_stateMachine, alma::acs::component::ComponentImplBase::name(), alma::ACS::impl::CharacteristicComponentImpl::registerProperty(), stateChangeNotificationChecker, subsysComponentMonitor, and updateStateHierarchy().
| final<T extends ACSComponent> void alma::ACS::MasterComponentImpl::MasterComponentImplBase::monitorComponent | ( | T | component, | |
| SubsysResourceMonitor.ResourceErrorHandler< T > | err | |||
| ) | [inline, protected] |
Subclasses can request to have the "health" of a given subsystem component monitored, and that the provided ResourceErrorHandler be called in case problems are detected.
Unlike method monitorComponent(ACSComponent), this method gives full control over the reaction to a detected failure. The master component can thus ignore or try to fix the problem, or eventually also go to error state (by calling doTransition(SubsystemStateEvent.SUBSYSEVENT_ERROR)).
Before a resource gets unloaded/released etc, its monitoring should be stopped to avoid false errors, using stopMonitoringResource(String) or stopMonitoringAllResources().
| component | the component that should be monitored | |
| err | a custom error handler. If null, then a default error handler will be used, and the master component will go to error state automatically (same as using monitorComponent(ACSComponent)). |
References monitorResource().
| final void alma::ACS::MasterComponentImpl::MasterComponentImplBase::monitorComponent | ( | ACSComponent | component | ) | [inline, protected] |
Subclasses can request to have the "health" of a given subsystem component monitored, and that the mastercomponent state be set to "Error" in case problems are detected with this component. It is then the responsibility of the operator or some other external actor to get the mastercomponent out of this error state again. In other words, this method helps to detect problems, but does not fix the problem itself.
Detected problems can be
Note that this is a simplified version of monitorComponent(ACSComponent, ComponentErrorHandler) and does not require the subclass to provide an error handler.
Before a resource gets unloaded/released etc, its monitoring should be stopped to avoid false errors, using stopMonitoringResource(String) or stopMonitoringAllResources().
| final<T extends PingableResourceOperations> void alma::ACS::MasterComponentImpl::MasterComponentImplBase::monitorPingableResource | ( | T | resource, | |
| String | name, | |||
| SubsysResourceMonitor.ResourceErrorHandler< T > | err | |||
| ) | [inline, protected] |
Like monitorComponent() but for objects implementing the PingableResource interface.
| resource | the resource that should be monitored | |
| err | a custom error handler. If null, then a default error handler will be used, and the master component will go to error state automatically (same as using monitorPingableResource(PingableResourceOperations)). |
References monitorResource().
| final void alma::ACS::MasterComponentImpl::MasterComponentImplBase::monitorPingableResource | ( | PingableResourceOperations | resource, | |
| String | name | |||
| ) | [inline, protected] |
Like monitorComponent(ACSComponent) but for objects implementing the PingableResource interface.
| resource | the resource that should be monitored |
| final<T> void alma::ACS::MasterComponentImpl::MasterComponentImplBase::monitorResource | ( | SubsysResourceMonitor.ResourceChecker< T > | checker, | |
| SubsysResourceMonitor.ResourceErrorHandler< T > | err, | |||
| int | monitorDelaySeconds | |||
| ) | [inline, protected] |
Subclasses can request to have the "health" of a given subsystem component monitored, and that the provided ResourceErrorHandler be called in case problems are detected.
Compared with the methods that allow monitoring a component, this method offers more flexibility: any kind of resource can be monitored, for which a custom ResourceChecker must be provided. Examples of resources include an "offshoot" remote object, a database, or a standalone-process such as Tomcat.
This method also takes the delay between monitor calls as a parameter, to allow adjusting the frequency of monitor calls on a per resource basis. Invalid values will result in the default delay being used.
Before a resource gets unloaded/released etc, its monitoring should be stopped to avoid false errors, using stopMonitoringResource(String) or stopMonitoringAllResources().
| checker | The checker that encapsulates the specifics of the methods to be checked. Must not be null. | |
| err | A custom error handler. If null, then a default error handler will be used, and the master component will go to error state automatically (see comment for method monitorComponent(ACSComponent). | |
| monitorDelaySeconds | The delay between two check calls. If monitorDelaySeconds < 1 then the default delay of 10 seconds will be used. | |
| <T> | The resource type. Used to enforce matching checker and error handler. |
References alma::ACS::MasterComponentImpl::SubsysResourceMonitor::monitorResource(), and subsysComponentMonitor.
Referenced by monitorComponent(), and monitorPingableResource().
| void alma::ACS::MasterComponentImpl::MasterComponentImplBase::stateChangedNotify | ( | AcsState[] | oldStateHierarchy, | |
| AcsState[] | currentStateHierarchy | |||
| ) | [inline] |
Will be called by the state machine implementation for every state change.
Normally you should not overload this method; if you do, make sure to call updateStateHierarchy() so that the state change propagates to the field which is visible from the outside of this component.
Implements alma::acs::genfw::runtime::sm::AcsStateChangeListener.
References alma::acs::component::ComponentImplBase::m_logger, and updateStateHierarchy().
| final void alma::ACS::MasterComponentImpl::MasterComponentImplBase::stopMonitoringAllResources | ( | ) | [inline, protected] |
Stops monitoring all resources that have been previously submitted for monitoring.
References alma::ACS::MasterComponentImpl::SubsysResourceMonitor::stopMonitoringAll(), and subsysComponentMonitor.
| final void alma::ACS::MasterComponentImpl::MasterComponentImplBase::stopMonitoringResource | ( | String | resourceName | ) | [inline, protected] |
Stops monitoring a resource. It is important to stop monitoring resources before they get released, for example when shutting down.
References alma::ACS::MasterComponentImpl::SubsysResourceMonitor::stopMonitoring(), and subsysComponentMonitor.
| void alma::ACS::MasterComponentImpl::MasterComponentImplBase::updateStateHierarchy | ( | ) | throws AcsJException [inline] |
Sets the property value of currentStateHierarchy to match the current (sub-)states from the state machine.
This method should not be overloaded by subclasses! We just don't make it final to meet special testing needs.
References alma::ACS::MasterComponentImpl::MasterComponentImplBase::StateChangeNotificationChecker::announceStateChangeNotification(), alma::acs::exceptions::AcsJCompletion::getAcsJException(), alma::ACS::MasterComponentImpl::statemachine::AlmaSubsystemContext::getCurrentTopLevelState(), alma::acs::exceptions::AcsJCompletion::isError(), m_currentStateHierarchyDataAccess, alma::acs::component::ComponentImplBase::m_logger, m_stateMachine, alma::ACS::jbaci::DataAccess::set(), stateChangeNotificationChecker, alma::acs::genfw::runtime::sm::AcsState::stateName(), and alma::ACSErr::CompletionHolder::value.
Referenced by initialize(), and stateChangedNotify().
ROstringSeq alma::ACS::MasterComponentImpl::MasterComponentImplBase::m_currentStateHierarchy [private] |
all nested states contained in one property for atomic access, listed from top-level state down to substates.
Referenced by currentStateHierarchy(), and initialize().
DataAccess alma::ACS::MasterComponentImpl::MasterComponentImplBase::m_currentStateHierarchyDataAccess [private] |
Referenced by initialize(), and updateStateHierarchy().
StateChangeNotificationChecker alma::ACS::MasterComponentImpl::MasterComponentImplBase::stateChangeNotificationChecker [private] |
Referenced by cleanUp(), initialize(), and updateStateHierarchy().
SubsysResourceMonitor alma::ACS::MasterComponentImpl::MasterComponentImplBase::subsysComponentMonitor [private] |
Referenced by cleanUp(), initialize(), monitorResource(), stopMonitoringAllResources(), and stopMonitoringResource().
1.6.2