* Create a Trade object and perform a specified number of
* random trades on it.
*/
public static void main(String inArgs[]) {
HelloClusterClient client = null;
ClusterUtils utils = null;
try {
client = new HelloClusterClient(inArgs);
} catch(NamingException e) {
System.out.println("Exception with server: " + url);
e.printStackTrace();
return;
}
utils = new ClusterUtils();
for(int i=0; i<getIterations(); i++) {
try {
String returnHello = client.hello();
if(client.verbose)
System.out.println(returnHello);
utils.addClusterMessage(returnHello);
// Thread.sleep(200); // pause for clarity
} catch(Exception e) {
e.printStackTrace();
utils.incrementExceptionCount();
}
}
System.out.println("\nCompleted " + utils.getIterations() +
" iterations with " + utils.getExceptionCount() +
" number of exceptions.");
System.out.println("\nNow processing aggregate results.\n\n");
System.out.println(utils.processStatistics());
}