1 package SOFA.SOFAnode.Run.DeplDockRegistry; 2 3 import java.rmi.Naming ; 4 import java.rmi.Remote ; 5 import java.rmi.RemoteException ; 6 import java.rmi.server.UnicastRemoteObject ; 7 8 public class RgRMIDockImpl extends UnicastRemoteObject implements RgRMIDock { 9 String rmiport; 10 String rmihost; 11 12 public RgRMIDockImpl() throws RemoteException { 13 rmiport = System.getProperty("sofa.rmiport","1099"); 14 rmihost = System.getProperty("sofa.rmihost","localhost"); 15 } 16 17 public void rebind(String name, Remote object) throws RemoteException , java.net.MalformedURLException , java.rmi.AccessException { 18 Naming.rebind("//"+rmihost+":"+rmiport+""+name, object); 19 } 21 22 public static void main(String [] argv) throws Exception { 23 if (System.getSecurityManager() == null) { 24 System.setSecurityManager(new java.rmi.RMISecurityManager ()); 25 } 26 27 String rmiport = System.getProperty("sofa.rmiport","1099"); 28 String rmihost = System.getProperty("sofa.rmihost","localhost"); 29 System.out.print("Registering..."); 30 Naming.rebind("//"+rmihost+":"+rmiport+"/RgRMIDock", new RgRMIDockImpl() ); 31 System.out.print("OK"); 32 } 33 } 34 | Popular Tags |