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.

36 lines
1.0 KiB

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();
}
}