Package examples.cluster.utils

Examples of examples.cluster.utils.ClusterUtils$Cluster


   * 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());
  }
View Full Code Here

TOP

Related Classes of examples.cluster.utils.ClusterUtils$Cluster

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.