Real-Time Java AOCS Framework v1.0 API Specification

RtjAocsFramework.BasicObjects
Class AocsObject

java.lang.Object
  |
  +--RtjAocsFramework.BasicObjects.RootObject
        |
        +--RtjAocsFramework.BasicObjects.AocsObject
All Implemented Interfaces:
Configurable, Resettable, Telemeterable
Direct Known Subclasses:
AbstractControlChannel, AocsData, AocsDataPool, BasicUnitReconfigurer, ChangeObject, Controller, ControllerManager, DummyAocsClock, EventRepository, FailureDetectionManager, FailureRecoveryManager, JbedSmmClock, JbedSmmTelecommandLoader, JbedSmmTelemetryStream, JbedSmmTmSender, Manoeuvre, ManoeuvreManager, ModeChangeAction, ModeManager, MonitoringCheck, ObjectList, ReconfigurerHelper, RecoveryAction, RecoveryStrategy, TelecommandManager, TelemetryManager, TestSmmClock, TestTelemetryStream, Unit, UnitManager, UnitTriggerStrategy

public class AocsObject
extends RootObject
implements Configurable, Telemeterable, Resettable

Base class from which most non-trivial framework classes are derived. This class provides the following services to its children classes: failure reporting, configuration error reporting, provision of timing information.

This class confers the following properties upon its children classes: resettability, telemeterability and configurability.

This class can fire two types of events: failure and configuration events. Failure events are fired when method reportFailure is called. Configuration events are fired when method reportConfigurationEvent is called. These methods would normally be called by children classes when they encounter a failure or a configuration problem.

Change Record:

Copyright: see the Copyright Notice.

Version:
1.3
Author:
Alessandro Pasetti (University of Konstanz)
See Also:
AocsClock, FailureEventRepository, ConfigurationEventRepository, SystemManager

Field Summary
 
Fields inherited from interface RtjAocsFramework.TelemetryManagement.Telemeterable
DEBUG_TM, LONG_TM, NORMAL_TM, NTMFORMATS, SHORT_TM
 
Constructor Summary
AocsObject()
          Register with system manager, set telemetry image length, and reset state.
 
Method Summary
static void addConfigurationListener(ConfigurationListener l)
          Initialization method to register failure listeners.
static void addFailureListener(FailureListener l)
          Initialization method to register failure listeners.
protected  void finalize()
          Report a failure if an AocsObject is destroyed.
static AocsClock getAocsClock()
           
static ConfigurationListenerList getConfigurationListenerList()
           
protected  int getCycle()
          Return the current time as provided by the AocsClock plug-in object.
static RecoveryAction getDestructionRecoveryAction()
           
static FailureListenerList getFailureListenerList()
           
static SystemManager getSystemManager()
           
 byte getTelemetryFormat()
          Return the current telemetry format.
 int getTelemetryImageLength()
          Return the length (in bits) of the telemetry image of the object.
 int getTime()
          Return the current time as provided by the AocsClock plug-in object.
 boolean isConfigured()
          Return false if some configuration data are missing.
static void removeConfigurationListener(ConfigurationListener l)
          Method to unregister configuration event listeners.
static void removeFailureListener(FailureListener l)
          Method to unregister failure listeners.
protected  void reportConfigurationEvent(short configType, AocsObject creator)
          Report a configuration event.
protected  void reportFailure(short failureType, AocsObject creator, RecoveryAction recoveryAction)
          Report a failure event.
 void reset()
          Bring the resettable state of the object to its initial default value.
 void resetConfiguration()
          Clear all configuration information.
static void resetStaticConfiguration()
          Unload all static plug-in objects and all registered listeners.
static void setAocsClock(AocsClock c)
           
static void setDestructionRecoveryAction(RecoveryAction r)
           
static void setMaxNumberOfConfigurationListeners(int n)
          Initialization method to initialize the list of listeners to configuration events.
static void setMaxNumberOfFailureListeners(int n)
          Initialization method to initialize the list of listeners to failure events.
static void setSystemManager(SystemManager s)
           
 void setTelemetryFormat(byte newFormat)
          Set the telemetry format to 'newFormat'.
 void writeToTelemetry(TelemetryStream tmStream)
          Direct the object to write its own state to the telemetry stream.
 
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

AocsObject

public AocsObject()
Register with system manager, set telemetry image length, and reset state. AOCS objects should be used only after the static part of AocsObject has been initialized.

Method Detail

reportFailure

protected void reportFailure(short failureType,
                             AocsObject creator,
                             RecoveryAction recoveryAction)
Report a failure event.

A failure event is an event that arises when the software detects an anomaly during its normal operation. This method is called by objects that wish to report a failure.

A failure event is configured and fired to the registered failure event listeners. In order to avoid dynamic memory allocation, the failure event is created during the application initialization phase.

Parameters:
failureType - failure type identifier.
creator - object issuing the failure report (this is normally the object that detected the failure).
recoveryAction - recovery action associated to the failure event.

reportConfigurationEvent

protected void reportConfigurationEvent(short configType,
                                        AocsObject creator)
Report a configuration event.

A configuration event is an event that arises during and is related to the process of configuring an object. This method is called by objects that wish to report a configuration event.

A configuration event is configured and fired to the registered configuration event listeners. In order to avoid dynamic memory allocation, the configuration event is created during the application initialization phase.

Parameters:
configType - configuration event type identifier

getTime

public int getTime()
Return the current time as provided by the AocsClock plug-in object.


getCycle

protected int getCycle()
Return the current time as provided by the AocsClock plug-in object.


finalize

protected void finalize()
Report a failure if an AocsObject is destroyed.

By design, AOCS objects should never be destroyed. If they are, a failure event is generated by the object destructor.

Overrides:
finalize in class Object

setAocsClock

public static void setAocsClock(AocsClock c)

getAocsClock

public static AocsClock getAocsClock()

setSystemManager

public static void setSystemManager(SystemManager s)

getSystemManager

public static SystemManager getSystemManager()

setDestructionRecoveryAction

public static void setDestructionRecoveryAction(RecoveryAction r)

getDestructionRecoveryAction

public static RecoveryAction getDestructionRecoveryAction()

getConfigurationListenerList

public static ConfigurationListenerList getConfigurationListenerList()

getFailureListenerList

public static FailureListenerList getFailureListenerList()

resetStaticConfiguration

public static void resetStaticConfiguration()
Unload all static plug-in objects and all registered listeners.


reset

public void reset()
Description copied from interface: Resettable
Bring the resettable state of the object to its initial default value. A call to method reset on an object A is sometimes propagated to objects that are logically contained in A (relationship of strong aggregation).

Specified by:
reset in interface Resettable

resetConfiguration

public void resetConfiguration()
Description copied from interface: Configurable
Clear all configuration information.

Calls to resetConfiguration are propagated to objects that are in a relationship of strong aggregation.

Specified by:
resetConfiguration in interface Configurable

isConfigured

public boolean isConfigured()
Description copied from interface: Configurable
Return false if some configuration data are missing.

Typically, a false value indicates that a plug-in component is missing or that the object has not been initialized. This is a negative check only: a return value of true cannot guarantee that the object is correctly configured.

Calls to resetConfiguration on an object A are normally not propagated objects of type AocsObject that are contained or otherwise aggregated to A. The rationale for this policy is that all objects of type AocsObject implement interface configurable and therefore their configuration status should be checked externally (probably through the configuration check service of the system manager).

Specified by:
isConfigured in interface Configurable

writeToTelemetry

public void writeToTelemetry(TelemetryStream tmStream)
Description copied from interface: Telemeterable
Direct the object to write its own state to the telemetry stream.

Specified by:
writeToTelemetry in interface Telemeterable

setTelemetryFormat

public void setTelemetryFormat(byte newFormat)
Description copied from interface: Telemeterable
Set the telemetry format to 'newFormat'.

Specified by:
setTelemetryFormat in interface Telemeterable

getTelemetryFormat

public byte getTelemetryFormat()
Description copied from interface: Telemeterable
Return the current telemetry format.

Specified by:
getTelemetryFormat in interface Telemeterable

getTelemetryImageLength

public int getTelemetryImageLength()
Description copied from interface: Telemeterable
Return the length (in bits) of the telemetry image of the object. This method is useful to verify that the quantity of data generated by a given object is compatible with the capacity of the telemetry channel.

Specified by:
getTelemetryImageLength in interface Telemeterable

setMaxNumberOfFailureListeners

public static void setMaxNumberOfFailureListeners(int n)
Initialization method to initialize the list of listeners to failure events. This method should only be called once. Attempts to call it more than once have no effect.


setMaxNumberOfConfigurationListeners

public static void setMaxNumberOfConfigurationListeners(int n)
Initialization method to initialize the list of listeners to configuration events. This method should only be called once. Attempts to call it more than once have no effect.


removeFailureListener

public static void removeFailureListener(FailureListener l)
Method to unregister failure listeners. This method is provided to ensure compliance with the JavaBeans architecture but should never be called since event listener lists are intended to be set up during initialization only.


addFailureListener

public static void addFailureListener(FailureListener l)
Initialization method to register failure listeners.


removeConfigurationListener

public static void removeConfigurationListener(ConfigurationListener l)
Method to unregister configuration event listeners. This method is provided to ensure compliance with the JavaBeans architecture but should never be called since event listener lists are intended to be set up during initialization only.


addConfigurationListener

public static void addConfigurationListener(ConfigurationListener l)
Initialization method to register failure listeners.


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