Real-Time Java AOCS Framework v1.0 API Specification

RtjAocsFramework.ModeManagement
Class FollowerModeManager

java.lang.Object
  |
  +--RtjAocsFramework.BasicObjects.RootObject
        |
        +--RtjAocsFramework.BasicObjects.AocsObject
              |
              +--RtjAocsFramework.ModeManagement.ModeManager
                    |
                    +--RtjAocsFramework.ModeManagement.FollowerModeManager
All Implemented Interfaces:
Configurable, EventListener, ModeListener, Monitorable, Resettable, Telemeterable
Direct Known Subclasses:
FollowerControllerModeManager, FollowerFailureDetectionModeManager, FollowerFailureRecoveryModeManager, FollowerUnitStrategyModeManager

public class FollowerModeManager
extends ModeManager
implements ModeListener

This class encapsulates a follower mode manager that uses the "reactive mode update" mechanism: its mode is the same as the mode of a master mode manager. The follower mode manager acts as a listener for the mode events fired by the master mode manager. Whenever it received a mode event that indicates a mode change in the master, it updates its own mode to be the same as that of the master.

The implementers are treated as instances of RootObject. Hence, this class should not be used by itself (except for testing) but should instead be placed in wrapper that performs the (potentially unsafe) type casts between RootObject and the type of the implementers.

Copyright: see the Copyright Notice.

Version:
1.0
Author:
Alessandro Pasetti (University of Konstanz)
See Also:
The Operational Mode Framelet Document., ModeEvent

Field Summary
 
Fields inherited from class RtjAocsFramework.ModeManagement.ModeManager
currentMode, nModes, nStrategies
 
Fields inherited from interface RtjAocsFramework.TelemetryManagement.Telemeterable
DEBUG_TM, LONG_TM, NORMAL_TM, NTMFORMATS, SHORT_TM
 
Constructor Summary
FollowerModeManager()
          Default constructor: the object should not be used before being initialized.
FollowerModeManager(int nStrategies, ModeManager master, int numberOfListeners)
          Constructor for class FollowerModeManager.
 
Method Summary
 void processModeEvent(ModeEvent evt)
          This mode is triggered by the reception of a mode event.
 void setDefaultMode(int n)
          Calling this method causes a configuration error.
 void setMasterModeManager(ModeManager master)
          Initialization method to set the master mode manager.
 void setNumberOfModes(int n)
          Calling this method causes a configuration error.
 
Methods inherited from class RtjAocsFramework.ModeManagement.ModeManager
addChangeListener, addModeListener, changeMode, disableMode, enableMode, fireChangeEvent, fireModeEvent, forceMode, getAocsObject, getDefaultMode, getImplementer, getMode, getModeChangeAction, getMonitorablePropertyValue, getNumberOfModes, getNumberOfMonitorableProperties, getTelemetryImageLength, isConfigured, isModeLegal, loadImplementer, notifyMonitors, releaseMode, removeChangeListener, removeModeListener, reset, resetConfiguration, setMaxNumberOfChangeListeners, setMaxNumberOfModeListeners, setMode, setModeChangeAction, setNumberOfStrategies, setPropertyMonitorListSize, updateMode, writeToTelemetry
 
Methods inherited from class RtjAocsFramework.BasicObjects.AocsObject
addConfigurationListener, addFailureListener, finalize, getAocsClock, getConfigurationListenerList, getCycle, getDestructionRecoveryAction, getFailureListenerList, getSystemManager, getTelemetryFormat, getTime, removeConfigurationListener, removeFailureListener, reportConfigurationEvent, reportFailure, resetStaticConfiguration, setAocsClock, setDestructionRecoveryAction, setMaxNumberOfConfigurationListeners, setMaxNumberOfFailureListeners, setSystemManager, setTelemetryFormat
 
Methods inherited from class RtjAocsFramework.BasicObjects.RootObject
getClassId, getInstanceId, setClassId
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FollowerModeManager

public FollowerModeManager(int nStrategies,
                           ModeManager master,
                           int numberOfListeners)
Constructor for class FollowerModeManager. Recall that the number of modes and the default mode must be the same as for the master mode manager and thereforedo not appear as a constructor parameter.

Parameters:
nStrategies - number of strategies associated to each mode.
master - master mode manager.
numberOfListeners - maximum number of listeners to mode events.

FollowerModeManager

public FollowerModeManager()
Default constructor: the object should not be used before being initialized. Initialization is performed by setting the number of strategies, the maximum number of mode event listeners, the mode change action, and the master mode manager. The number of modes and the default mode are set to the same value as for the master mode manager.

Method Detail

setDefaultMode

public void setDefaultMode(int n)
Calling this method causes a configuration error. The default mode is always equal to the default mode of the master mode manager.

Overrides:
setDefaultMode in class ModeManager

setNumberOfModes

public void setNumberOfModes(int n)
Calling this method causes a configuration error. The number of modes is always equal to the number of modes of the master mode manager.

Overrides:
setNumberOfModes in class ModeManager

setMasterModeManager

public void setMasterModeManager(ModeManager master)
Initialization method to set the master mode manager. This method should be called only once. Attempts to call it more than once will result in a configuration error. This method sets the number of modes and the default mode of the follower mode manager by copying them from the master. This method also registers the follower mode manager as a listener to mode events fired by the master. This method should only be called after the number of strategies in the mode manager have been set (else a configuration error is declared).


processModeEvent

public void processModeEvent(ModeEvent evt)
This mode is triggered by the reception of a mode event. If the mode event originates from the master mode manager, then the mode is updated to reflect the mode of the master.

Specified by:
processModeEvent in interface ModeListener

Real-Time Java AOCS Framework v1.0 API Specification

Real-Time Java AOCS Framework project home page

Automatic Control Laboratory, ETH Zuerich
Physikstrasse 3
CH-8092 Zuerich, Switzerland