Java Reference
In-Depth Information
L ISTING 6.2 Continued
}
/**
* This method shuts down the whole application
*
*/
private void shutDown() throws IOException {
System.out.println(“ApplicationHelper- closing application.”);
out.writeChar('q');
out.close();
in.close();
socket.close();
saveProperties();
}
/**
* save deployment properties
*/
private void saveProperties(){
try {
FileOutputStream out = new FileOutputStream(CLIENT_DIR+PROPS_FILE_NAME);
appHelperSettings.store(out, “— Application Helper Properties file —”);
out.close();
}
catch (IOException ex) {
System.out.println(“ApplicationHelper- saveProperties(): “+ex);
}
}
/**
* Main method that launches the appl. helper and consequently,
* the whole application
*/
public static void main(String[] args) {
ApplicationHelper applicationHelper = new ApplicationHelper();
applicationHelper.launch();
}
}
In its constructor, the ApplicationHelper instance tries to connect to the server (generally the
deployment server is different from the business server, not like this simple case). Depending
Search WWH ::




Custom Search