Real-Time Java AOCS Framework v1.0 API Specification

RtjAocsFramework.AocsEvent
Class AocsEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--RtjAocsFramework.AocsEvent.AocsEvent
All Implemented Interfaces:
Configurable, Resettable, Serializable, Telemeterable
Direct Known Subclasses:
ChangeEvent, ConfigurationEvent, FailureEvent, ManoeuvreEvent, ModeEvent, ReconfigurationEvent, RecoveryEvent, SystemEvent, TelecommandEvent

public class AocsEvent
extends EventObject
implements Telemeterable, Resettable, Configurable

Base class from which all AOCS event classes are derived.

The AocsEvent class adds the following attributes to the basic java event class: a time stamp, a reference to the AOCS clock, an event type identifier. The time stamp is set every time the event is initialized. The current time is retrieved from the AOCS clock.

In addition to getter methods for the event attributes, a initialization method is provided. The initialization method allows all the event attributes to be set.

AOCS events need an initialization method because they are not created dynamically (due to the restrictions of the real-time character of AOCS applications). Objects that need to fire events, create the event object during the application initialization phase and initialize it before it is fired. The event listener should retrieve the event attributes it needs and then release the event. The event firing should be performed in a synchronized section that locks the event itself.

Copyright: see the Copyright Notice.

Version:
1.0
Author:
Alessandro Pasetti (University of Konstanz)
See Also:
The Intercomponent Communication Document., Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Fields inherited from interface RtjAocsFramework.TelemetryManagement.Telemeterable
DEBUG_TM, LONG_TM, NORMAL_TM, NTMFORMATS, SHORT_TM
 
Constructor Summary
AocsEvent(Object dummySource)
          Create an AOCS Event.
 
Method Summary
 AocsObject getCreator()
           
 short getEventType()
           
 byte getTelemetryFormat()
          Return the current telemetry format.
 int getTelemetryImageLength()
          Return the length (in bits) of the telemetry image of the object.
 int getTimeStamp()
           
 void initialize(AocsObject creator, short evtType)
          Initialize the event prior to firing it.
 boolean isConfigured()
          Return false if some configuration data are missing.
 void reset()
          Bring the resettable state of the object to its initial default value.
 void resetConfiguration()
          Clear all configuration information.
 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 java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AocsEvent

public AocsEvent(Object dummySource)
Create an AOCS Event. Framework events should be instantiated from dedicated classes derived from AocsEvent. The argument is a dummy that is required only for compatiblity with the Java event model: class EventObject requires a non-null event source. In the framework, the source of the event is a settable parameter in class AocsEvent. The event source (or event creator) must be dynamically settable because event objects cannot be created dynamically.

Method Detail

initialize

public void initialize(AocsObject creator,
                       short evtType)
Initialize the event prior to firing it. The time stamp is retrieved from the plug-in AOCS clock.

Parameters:
creator - object creating the event. This is also assigned to the event source. Within the framework, only the creator field in class AocsEvent is used to avoid type casting from Object to AocsObject and to allow the creator to be a settable property.

evtType - = event type identifier.

getTimeStamp

public int getTimeStamp()

getEventType

public short getEventType()

getCreator

public AocsObject getCreator()

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

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