Developers guide
93
LogCommand.class,
MasterswitchSwitchOutletCommand.class,
MasterswitchRenameOutletCommand.class
};
Figure B-2 APT command sets
B.5. JAS channel monitoring
In many cases, it is useful to be able to determine, when a client joins or leaves a JAS Channel.
For example, when the Roof software
i
detects that a new client has joined Channels.ROOF all
the roof telemetry is sent to that client. From this point onward, roof information is only sent when
it has been requested
ii
, or when it changes.
/* Procedure for discovering when new clients have been added to a
* JASChannel
*/
...
jasChannnel.getChannel().addChannelListener( new ChannelWatcher() );
...
// Extend the JSDT ChannelAdaptor
private class ChannelMonitor extends ChannelAdaptor {
public void channelConsumerAdded(ChannelEvent event) {
// Extend the JSDT ChannelAdaptor
}
public void channelConsumerRemoved(ChannelEvent event) {
// Extend the JSDT ChannelAdaptor
}
}
Figure B-3 Implementing a ChannelMonitor
This implementation highlights one of the flaws in the JAS, its dependence on the JSDT. The
jasChannnel.getChannel() method returns a JSDT Channel object. Consequently, the
ChannelAdaptor and ChannelListener classes are also JSDT objects.
i
apt.modules.roof
ii
Using apt.jas.BroadcastRoofCommand










