KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > SOFA > SOFAnet > Local > RMI > RMILocalServer


1 /*
2  * RMILocalServer.java
3  *
4  * Created on 3. květen 2004, 16:27
5  */

6
7 package SOFA.SOFAnet.Local.RMI;
8
9 import java.rmi.server.UnicastRemoteObject JavaDoc;
10 import java.rmi.server.ServerNotActiveException JavaDoc;
11 import java.rmi.RemoteException JavaDoc;
12 import SOFA.SOFAnet.Core.LocalOps;
13 import SOFA.SOFAnet.Core.CoreException;
14
15 /**
16  * RMI server that implemets "Local interface" - RMILocalInterface - for SOFA runtime
17  *
18  * @author Ladislav Sobr
19  */

20 public class RMILocalServer extends UnicastRemoteObject JavaDoc implements RMILocalInterface
21 {
22   private LocalOps localOps;
23   
24   /** Creates a new instance of RMILocalServer */
25   public RMILocalServer(LocalOps localOps) throws RemoteException JavaDoc
26   {
27     this.localOps = localOps;
28   }
29   
30   public int acquireComponent(String JavaDoc componentFullName) throws RemoteException JavaDoc
31   {
32     return localOps.acquireComponent(componentFullName);
33   }
34   
35   public int releaseComponent(String JavaDoc componentFullName) throws RemoteException JavaDoc
36   {
37     return localOps.releaseComponent(componentFullName);
38   }
39   
40   public int obtainMissingComponent(String JavaDoc componentFullName) throws RMILocalException, RemoteException JavaDoc
41   {
42     try
43     {
44       return localOps.obtainMissingComponent(componentFullName);
45     }
46     catch (CoreException e)
47     {
48       throw new RMILocalException(e.getMessage(), e);
49     }
50   }
51 }
52
Popular Tags