summaryrefslogtreecommitdiffstats
path: root/Dozentenmodul/src/rmi/RmiClientMethods.java
diff options
context:
space:
mode:
Diffstat (limited to 'Dozentenmodul/src/rmi/RmiClientMethods.java')
-rw-r--r--Dozentenmodul/src/rmi/RmiClientMethods.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/Dozentenmodul/src/rmi/RmiClientMethods.java b/Dozentenmodul/src/rmi/RmiClientMethods.java
new file mode 100644
index 00000000..58df1734
--- /dev/null
+++ b/Dozentenmodul/src/rmi/RmiClientMethods.java
@@ -0,0 +1,29 @@
+package rmi;
+import java.rmi.*;
+import server.*;
+
+public class RmiClientMethods {
+
+ public ServerInterface getInterface()
+ {
+ String strName = "rmi://141.79.128.121:9999/TheRMIExample";
+ System.out.println("Client: Looking up " + strName + "...");
+ ServerInterface RMI = null;
+
+ try
+ {
+
+ RMI = (ServerInterface)Naming.lookup(strName);
+
+ }
+ catch (Exception e)
+ {
+ System.out.println("Client: Exception thrown looking up " + strName);
+ System.out.println("Client: " + e.getMessage().toString());
+ System.exit(1);
+ }
+ return RMI;
+ }
+
+
+}