stateblock GlobalNetworkOpenState augments RNetwork {
addstate RNetwork.openConnections: ObjectSet = new ObjectSet();
addstate RNetwork.openListeners: ObjectSet = new ObjectSet();
addstate RNetwork.openEnds: ObjectSet = new ObjectSet();
precode postOpenConnection (connection: RNetConnection) {
openConnections.add (connection);
}
postcode closeConnection (connection: RNetConnection) {
openConnections.remove (connection);
}
postcode terminate() {
debugMessage ("Unclosed connections: " + openConnections.toString());
}
precode postOpenEnd(end: RNetEnd) {
openEnds.add (end);
}
postcode closeEnd (end: RNetEnd) {
openEnds.remove (end);
}
precode postOpenListener (lis: RNetListener) {
openListeners.add (lis);
}
postcode closeListener (lis: RNetListener) {
openListeners.remove (lis);
}
postcode terminate () {
if (openListeners.size () > 0) {
debugMessage ("Unclosed listeners: " + openListeners.toString());
}
if (openEnds.size () > 0) {
debugMessage ("Unclosed ends: " + openEnds.toString());
}
}
}
Naccio Home Page
University of Virginia, Computer Science