/Users/lyon/j4p/src/net/rmi/armi/RemoteHelloImplementation.java

1    package net.rmi.armi; 
2     
3    // net.rmi.armi.RemoteHelloImplementation; 
4     
5    import net.rmi.utils.Compile; 
6     
7    import java.rmi.RemoteException; 
8    import java.rmi.server.UnicastRemoteObject; 
9     
10   public class RemoteHelloImplementation 
11           extends UnicastRemoteObject 
12           implements RemoteHelloInterface { 
13       HelloWorld hw = new HelloWorld(); 
14    
15       public static void main(String[] args) { 
16           boolean stubsGenerated = generateStubs(); 
17           System.out.println("generated Stubs"); 
18       } 
19    
20       private static boolean generateStubs() { 
21           Compile.rmic(RemoteHelloImplementation.class); 
22           return true; 
23       } 
24    
25       public RemoteHelloImplementation() 
26               throws RemoteException { 
27       } 
28    
29       public void testGetMsg() throws RemoteException { 
30           hw.testGetMsg(); 
31       } 
32    
33       public String getMsg() throws RemoteException { 
34           return hw.getMsg(); 
35       } 
36   } 
37    
38   // use the rmic compiler to create a stub 
39   // rmic -v1.2 -d . net.rmi.armi.RemoteHelloImplementation 
40