package examples.rmi.multihello;

import weblogic.rmi.*;

/**
 * This simple example uses WebLogic RMI to say "Hello World" multiple
 * times. Note that there is no explicit creation of a T3Client nor
 * connection to a WebLogic Server, although this program runs as a
 * T3Client application.
 *
 * @author Copyright (c) 1997-98 by WebLogic, Inc. All Rights Reserved.
 * @author Copyright (c) 1999-2000 by BEA Systems, Inc. All Rights Reserved.
 */
public class sayHello {

  /**
   * Runs this example from the command line.
   */
  public static void main(String argv[]) throws Exception {
    
    for (int i = 0; i < 10; i++) {
      if (argv.length != 1) {
          System.out.println("Usage: java examples.rmi.multihello.sayHello WebLogicURL");
          return;
      }
      Hello obj = (Hello)Naming.lookup(argv[0]+"/MultiHelloServer" + i);
      for (int j = 0; j < 10; j++) {
	obj.sayHello();
	System.out.println(obj.sayHello() + " " + j);
      }
    }
  }
}

