|
|
@ -0,0 +1,36 @@ |
|
|
|
package verteiltesysteme.rmi; |
|
|
|
|
|
|
|
import java.rmi.*; |
|
|
|
import java.rmi.server.*; |
|
|
|
import java.rmi.registry.*; |
|
|
|
|
|
|
|
public class RMIEchoServer implements RMIEchoInterface { |
|
|
|
public RMIEchoServer() {} |
|
|
|
|
|
|
|
public static void main(String args[]) { |
|
|
|
|
|
|
|
try { |
|
|
|
RMIEchoServer obj = new RMIEchoServer(); |
|
|
|
RMIEchoInterface stub = (RMIEchoInterface) UnicastRemoteObject.exportObject(obj, 0); |
|
|
|
|
|
|
|
// Bind the remote object's stub in the registry |
|
|
|
Registry registry = LocateRegistry.getRegistry(); |
|
|
|
registry.bind("RMIEchoInterface", stub); |
|
|
|
|
|
|
|
System.err.println("Server ready"); |
|
|
|
} catch (Exception e) { |
|
|
|
System.err.println("Server exception: " + e.toString()); |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public String toLowerCase(String input) throws RemoteException { |
|
|
|
return input.toLowerCase(); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public String toUpperCase(String input) throws RemoteException { |
|
|
|
return input.toUpperCase(); |
|
|
|
} |
|
|
|
} |