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:[EMAIL PROTECTED]";>Eung-ju Park</a>
  + * @author <a href="mailto:[EMAIL PROTECTED]";>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:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to