Classes | Public Member Functions | Protected Member Functions | Static Package Functions

alma.ACS.MasterComponentImpl.MasterComponentImplBase Class Reference

Inheritance diagram for alma.ACS.MasterComponentImpl.MasterComponentImplBase:
alma.ACS.impl.CharacteristicComponentImpl alma.acs.genfw.runtime.sm.AcsStateChangeListener alma.acs.component.ComponentImplBase alma.ACS.jbaci.PrioritizedExecutor alma.acs.component.ComponentLifecycle

List of all members.

Classes

class  DefaultResourceErrorHandler< T >
class  StateChangeNotificationChecker

Public Member Functions

void initialize (ContainerServices containerServices) throws ComponentLifecycleException
void cleanUp () throws AcsJComponentCleanUpEx
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)

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 (  )  throws AcsJComponentCleanUpEx
final ROstringSeq alma.ACS.MasterComponentImpl.MasterComponentImplBase.currentStateHierarchy (  ) 
See also:
alma.ACS.MasterComponentOperations.currentStateHierarchy()
updateStateHierarchy()
final synchronized void alma.ACS.MasterComponentImpl.MasterComponentImplBase.doTransition ( SubsystemStateEvent  event  )  throws IllegalStateEventEx
static String alma.ACS.MasterComponentImpl.MasterComponentImplBase.event2Name ( SubsystemStateEvent  event  )  [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.

Referenced by alma.ACS.MasterComponentImpl.MasterComponentImplBase.doTransition().

abstract AlmaSubsystemActions alma.ACS.MasterComponentImpl.MasterComponentImplBase.getActionHandler (  )  [protected, pure virtual]

Subsystem state machine actions, to be implemented by concrete subclasses.

Referenced by alma.ACS.MasterComponentImpl.MasterComponentImplBase.initialize().

final void alma.ACS.MasterComponentImpl.MasterComponentImplBase.monitorComponent ( ACSComponent  component  )  [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 ACSComponent> void alma.ACS.MasterComponentImpl.MasterComponentImplBase.monitorComponent ( T  component,
SubsysResourceMonitor.ResourceErrorHandler< T err 
) [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

References alma.ACS.MasterComponentImpl.MasterComponentImplBase.monitorResource().

final void alma.ACS.MasterComponentImpl.MasterComponentImplBase.monitorPingableResource ( PingableResourceOperations  resource,
String  name 
) [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 extends PingableResourceOperations> void alma.ACS.MasterComponentImpl.MasterComponentImplBase.monitorPingableResource ( T  resource,
String  name,
SubsysResourceMonitor.ResourceErrorHandler< T err 
) [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

References alma.ACS.MasterComponentImpl.MasterComponentImplBase.monitorResource().

final<T> void alma.ACS.MasterComponentImpl.MasterComponentImplBase.monitorResource ( SubsysResourceMonitor.ResourceChecker< T checker,
SubsysResourceMonitor.ResourceErrorHandler< T err,
int  monitorDelaySeconds 
) [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

References alma.ACS.MasterComponentImpl.SubsysResourceMonitor.monitorResource().

Referenced by alma.ACS.MasterComponentImpl.MasterComponentImplBase.monitorComponent(), and alma.ACS.MasterComponentImpl.MasterComponentImplBase.monitorPingableResource().

void alma.ACS.MasterComponentImpl.MasterComponentImplBase.stateChangedNotify ( AcsState[]  oldStateHierarchy,
AcsState[]  currentStateHierarchy 
)

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[])

Implements alma.acs.genfw.runtime.sm.AcsStateChangeListener.

References alma.acs.component.ComponentImplBase.m_logger, and alma.ACS.MasterComponentImpl.MasterComponentImplBase.updateStateHierarchy().

final void alma.ACS.MasterComponentImpl.MasterComponentImplBase.stopMonitoringAllResources (  )  [protected]

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

See also:
stopMonitoringResource(String)

References alma.ACS.MasterComponentImpl.SubsysResourceMonitor.stopMonitoringAll().

final void alma.ACS.MasterComponentImpl.MasterComponentImplBase.stopMonitoringResource ( String  resourceName  )  [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()

References alma.ACS.MasterComponentImpl.SubsysResourceMonitor.stopMonitoring().

void alma.ACS.MasterComponentImpl.MasterComponentImplBase.updateStateHierarchy (  )  throws AcsJException

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties