You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
842 B

  1. package verteiltesysteme.rmi;
  2. import java.rmi.registry.LocateRegistry;
  3. import java.rmi.registry.Registry;
  4. public class RMIEchoClient {
  5. private RMIEchoClient() {}
  6. public static void main(String[] args) {
  7. String host = (args.length < 1) ? null : args[0];
  8. try {
  9. Registry registry = LocateRegistry.getRegistry(host);
  10. RMIEchoInterface stub = (RMIEchoInterface) registry.lookup("RMIEchoInterface");
  11. String response = stub.toLowerCase("hAlLo");
  12. System.out.println("response: " + response);
  13. response = stub.toUpperCase("hAlLo");
  14. System.out.println("response: " + response);
  15. } catch (Exception e) {
  16. System.err.println("Client exception: " + e.toString());
  17. e.printStackTrace();
  18. }
  19. }
  20. }