1 6 7 package SOFA.SOFAnet.Local.RMI; 8 9 import java.rmi.server.UnicastRemoteObject ; 10 import java.rmi.server.ServerNotActiveException ; 11 import java.rmi.RemoteException ; 12 import SOFA.SOFAnet.Core.LocalOps; 13 import SOFA.SOFAnet.Core.CoreException; 14 15 20 public class RMILocalServer extends UnicastRemoteObject implements RMILocalInterface 21 { 22 private LocalOps localOps; 23 24 25 public RMILocalServer(LocalOps localOps) throws RemoteException 26 { 27 this.localOps = localOps; 28 } 29 30 public int acquireComponent(String componentFullName) throws RemoteException 31 { 32 return localOps.acquireComponent(componentFullName); 33 } 34 35 public int releaseComponent(String componentFullName) throws RemoteException 36 { 37 return localOps.releaseComponent(componentFullName); 38 } 39 40 public int obtainMissingComponent(String componentFullName) throws RMILocalException, RemoteException 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 |