// LookupClient.java import EDU.unca.cs.brock.csci363.LineCount ; import java.rmi.*; import java.rmi.server.*; public class LineCountClient { public static void main(String args[]) { String URLname = "" ; try { RMISecurityManager security = new RMISecurityManager(); System.setSecurityManager(security); String RemoteHostName ; if (args.length > 0) RemoteHostName = args[0] ; else RemoteHostName = "penrose.cs.unca.edu" ; URLname = "rmi://" + RemoteHostName + "/LineCountServer" ; LineCount remote_obj = (LineCount)Naming.lookup(URLname); int PresCount = remote_obj.Process("A line\nwith 3\nreturns\n") ; System.err.println(PresCount) ; } catch (RemoteException e) { System.err.println("Remote exception at " + URLname + ": " + e) ; System.exit(1); } catch (Throwable e) { System.err.println("exception: " + e); System.exit(1); } } }