Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

alma::ACS::MasterComponentImpl::MasterComponentImplBase Class Reference

Inheritance diagram for alma::ACS::MasterComponentImpl::MasterComponentImplBase:

Inheritance graph
[legend]
Collaboration diagram for alma::ACS::MasterComponentImpl::MasterComponentImplBase:

Collaboration graph
[legend]
List of all members.

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

String event2Name (SubsystemStateEvent event)

Private Attributes

ROstringSeq m_currentStateHierarchy
DataAccess m_currentStateHierarchyDataAccess
AlmaSubsystemContext m_stateMachine
SubsysResourceMonitor subsysComponentMonitor
StateChangeNotificationChecker stateChangeNotificationChecker

Detailed Description

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.

Author:
hsommer created Mar 16, 2004 3:02:37 PM


Member Function Documentation

void alma::ACS::MasterComponentImpl::MasterComponentImplBase::cleanUp  )  [inline]
 

Master component subclasses must call super.cleanUp() if they override this method!

See also:
alma.ACS.impl.CharacteristicComponentImpl::cleanUp()

final ROstringSeq alma::ACS::MasterComponentImpl::MasterComponentImplBase::currentStateHierarchy  )  [inline]
 

See also:
alma.ACS.MasterComponentOperations::currentStateHierarchy()

updateStateHierarchy()

Implements alma::ACS::MasterComponentReadOnlyOperations.

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.

See also:
alma.ACS.MasterComponentOperations::doTransition(alma.ACS.MasterComponentPackage.SubsystemStateEvent)

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.

Parameters:
event a subsystem state event as declared in IDL
Returns:
informal name of the event, or null if the event is unknown.

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.

void alma::ACS::MasterComponentImpl::MasterComponentImplBase::initialize ContainerServices  containerServices  )  throws ComponentLifecycleException [inline]
 

Master component subclasses must call super.initialize() if they override this method!

See also:
alma.acs.component.ComponentLifecycle::initialize(alma.acs.container.ContainerServices)

final<T extends ACSComponent> void alma::ACS::MasterComponentImpl::MasterComponentImplBase::monitorComponent 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().

Parameters:
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)).
Since:
ACS 6.0

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

  1. the component can not be reached at all within 10 seconds, or
  2. the method componentState returns a state other than OPERATIONAL.

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().

Since:
ACS 6.0

final<T extends PingableResourceOperations> void alma::ACS::MasterComponentImpl::MasterComponentImplBase::monitorPingableResource resource,
String  name,
SubsysResourceMonitor.ResourceErrorHandler< T >  err
[inline, protected]
 

Like monitorComponent() but for objects implementing the PingableResource interface.

Parameters:
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)).
Since:
ACS 7.0

final void alma::ACS::MasterComponentImpl::MasterComponentImplBase::monitorPingableResource PingableResourceOperations  resource,
String  name
[inline, protected]
 

Like monitorComponent(ACSComponent) but for objects implementing the PingableResource interface.

Parameters:
resource the resource that should be monitored
Since:
ACS 7.0

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().

Parameters:
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 &lt 1 then the default delay of 10 seconds will be used.
<T> The resource type. Used to enforce matching checker and error handler.
Since:
ACS 6.0

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.

See also:
alma.ACS.MasterComponentImpl.statemachine.AcsStateChangeListener#stateChangedNotify(alma.ACS.MasterComponentImpl.statemachine.AcsState[], alma.ACS.MasterComponentImpl.statemachine.AcsState[])

final void alma::ACS::MasterComponentImpl::MasterComponentImplBase::stopMonitoringAllResources  )  [inline, protected]
 

Stops monitoring all resources that have been previously submitted for monitoring.

See also:
stopMonitoringResource(String)

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.

See also:
monitorComponent(ACSComponent)

monitorComponent(ACSComponent, alma.ACS.MasterComponentImpl.SubsysResourceMonitor.ResourceErrorHandler)

monitorResource(alma.ACS.MasterComponentImpl.SubsysResourceMonitor.ResourceChecker, alma.ACS.MasterComponentImpl.SubsysResourceMonitor.ResourceErrorHandler, int)

stopMonitoringAllResources()

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.


Member Data Documentation

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.

DataAccess alma::ACS::MasterComponentImpl::MasterComponentImplBase::m_currentStateHierarchyDataAccess [private]
 

AlmaSubsystemContext alma::ACS::MasterComponentImpl::MasterComponentImplBase::m_stateMachine [private]
 

StateChangeNotificationChecker alma::ACS::MasterComponentImpl::MasterComponentImplBase::stateChangeNotificationChecker [private]
 

SubsysResourceMonitor alma::ACS::MasterComponentImpl::MasterComponentImplBase::subsysComponentMonitor [private]
 


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 02:54:01 2009 for ACS Java API by doxygen 1.3.8