public class HelloImpl
1: import java.rmi.*;
2: import java.rmi.server.UnicastRemoteObject;
3:
4: public class HelloImpl
5: extends UnicastRemoteObject
6: implements Hello {
7: private String name;
8: public HelloImpl(String s)
9: throws java.rmi.RemoteException {
10: super();
11: name = s;
12: }
13:
14: public String sayHello() throws RemoteException {
15: return "Hello from Venus!";
16: }
17:
18: public static void main(String args[]) {
19: System.setSecurityManager(new RMISecurityManager());
20: try {
21: HelloImpl obj = new HelloImpl("HelloServer");
22: Naming.rebind("HelloServer", obj);
23: } catch (Exception e) {}
24: }
25: }