// Copyright © 1998 Sun Microsystems, Inc. All Rights Reserved. // package examples.activation; import java.rmi.*; import java.util.Vector; public class Client4 { public static void main(String args[]) { String server = "localhost"; if (args.length < 1) { System.out.println ("Usage: java Client "); System.exit(1); } else { server = args[0]; } try { String location = "rmi://" + server + "/MyPersistentClass"; YetAnotherRemoteInterface yari = (YetAnotherRemoteInterface)Naming.lookup(location); System.out.println("Got a remote reference to the class " + "MyPersistentClass"); // "result" will be appended to by the remote method call // Vector result = new Vector (1,5); result.addElement("Deposited money"); result.addElement("Withdrew money"); result.addElement("Transferred money from Savings"); result.addElement("Check cleared"); result.addElement("Point-of-sale charge at grocery store"); result = (Vector)yari.calltheServer(result); System.out.println("Called the remote method"); System.out.println("Result: "); for (int i = 0; i < result.size(); i++) { System.out.println(result.elementAt(i)); } } catch (Exception e) { System.out.println("Exception: " + e); e.printStackTrace(); } } }