Developers guide
91
B. JAS programming techniques
B.1. Introduction
This appendix is intended to be a simple programming guide for interacting with the APT using
the JAS. It is intended to be used as a reference for code patterns and techniques when adding
or modifying the APT-JAS application.
B.2. JAS message sender
Many of the subsystems at the APT are responsible for sending telemetry information to clients.
The JASChannel object supports two methods for sending JASMessages:
• JASChannel.sendToAll( JASMessage msg )
• JASChannel.sendToClient( JASMessage msg, String client )
A JASMessage object can be extended to allow any Java object
i
to be distributed to JASClients.
In the case of the APT, JASMessages used for telemetry information are a collection of
<key>/<value> paired data, stored in a Java Map object, sent to clients as a JASStatusMessage.
The PTCS_CHANNEL_3SEC JASChannel sends a PTCSStatusMessage, which is actually a
subclass of JASStatusMessage, every three seconds. Note that a JASStatusMessage alone is
sufficient for this purpose. The PTCSStatusMessage is intended to provide more efficient
customised serialisation.
B.3. BoundComponent framework
JASClients receiving JASMessages are typically designed to display this information in a GUI of
some sort. The BoundComponent framework developed by Keith Bannister in [ 52 ], was
designed to simplify this process.
BoundComponents were designed to be used with JASStatusMessages. When a
JASStatusMessage arrives on a channel, the JASStatusMessageManager updates the values of
all the GUI components registered to it. Each GUI component is Bound to a specific key within
the Map of data stored by the JASStatutsMessage.
The BoundComponent framework has been extended to support a richer set of GUI components.
JASChatMessageManager and JASLogMessageManagers have been introduced to handle
JASChatMessages and JASLogMessages and function in a similar fashion to the
JASStatusMessageManager.
B.4. Creating JAS commands
i
All objectcs contained by in JASMessage must be serializable










