Java Reference
In-Depth Information
// starts the thread
Thread thread # new Thread( this );
thread.start();
// sends a message to the server to start the Runner
// service
String path # getParameter("PATH");
output.println("START jogging.server.Runner " ! path);
output.flush();
} catch (Exception e) { e.printStackTrace(); }
}
public void run() {
while ( true )
try {
String message # input.readLine();
String str # message.substring(6).trim();
String eventName # str.substring(0,
str.indexOf(' ')).trim();
str # str.substring(str.indexOf("POSITION "));
str # str.substring(8).trim();
pathPanel.currentPos # Integer.parseInt(str);
pathPanel.repaint();
} catch (IOException ioe) {ioe.printStackTrace();}
}
void speedSlider_stateChanged(ChangeEvent e) {
output.println("MSG: SPEED " ! speedSlider.getValue());
output.flush();
}
}
19.7
Extension
The reader can adopt the MMI framework to develop new versions of the
case studies presented in previous chapters. The following extensions are
increasingly challenging.
Chapter 14 (Supermarket operation support system) and Chapter 15
(Geographic information system): client and server components can be
implemented using the framework's classes.
Chapter 13 (Supervisory control and data acquisition system): tank con-
trollers and the physical devices (pumps and tanks) can be redesigned in
order to support asynchronous communication.
Chapter 9 (Manufacturing work cell) and Chapter 11 (Car parking): the
simulators can be transformed into fully distributed systems.
 
Search WWH ::




Custom Search