avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From je...@apache.org
Subject cvs commit: jakarta-avalon-apps/demo/src/java/org/apache/avalon/apps/demos/rmihelloworldserver RMIHelloWorldClient.java
Date Mon, 08 Jul 2002 00:23:04 GMT
jefft       2002/07/07 17:23:04

  Modified:    demo/src/java/org/apache/avalon/apps/demos/rmihelloworldserver
                        RMIHelloWorldClient.java
  Log:
  Get working with new package name (cornerstone -> apps), and add some cmdline
  error handling
  
  Revision  Changes    Path
  1.3       +6 -1      jakarta-avalon-apps/demo/src/java/org/apache/avalon/apps/demos/rmihelloworldserver/RMIHelloWorldClient.java
  
  Index: RMIHelloWorldClient.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-apps/demo/src/java/org/apache/avalon/apps/demos/rmihelloworldserver/RMIHelloWorldClient.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RMIHelloWorldClient.java	14 May 2002 11:02:55 -0000	1.2
  +++ RMIHelloWorldClient.java	8 Jul 2002 00:23:04 -0000	1.3
  @@ -14,18 +14,23 @@
    * Client for <code>RMIHelloWorldServer</code>.
    *
    * @author <a href="mailto:colus@apache.org">Eung-ju Park</a>
  + * @author <a href="mailto:jefft@apache.org">Jeff Turner</a>
    */
   public class RMIHelloWorldClient
   {
       public static void main( final String[] args )
           throws Exception
       {
  +        if (args.length != 3) {
  +            System.err.println("Usage: "+RMIHelloWorldClient.class.getName()+" <host>
<port> <text>");
  +            return;
  +        }
           final String host = args[ 0 ];
           final int port = Integer.parseInt( args[ 1 ] );
           final String yourName = args[ 2 ];
   
           final Registry registry = LocateRegistry.getRegistry( host, port );
  -        final RMIHelloWorldServer server = (RMIHelloWorldServer)registry.lookup( "org/apache/avalon/cornerstone/demos/rmihelloworldserver/RMIHelloWorldServer"
);
  +        final RMIHelloWorldServer server = (RMIHelloWorldServer)registry.lookup( "org/apache/avalon/apps/demos/rmihelloworldserver/RMIHelloWorldServer"
);
           System.out.println( "sayHello( " + yourName + " ): " + server.sayHello( yourName
) );
       }
   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message