/* * Created on Apr 29, 2005 */ package rmi; import java.net.MalformedURLException; import java.rmi.Naming; import java.rmi.RemoteException; import java.rmi.registry.LocateRegistry; import line.goOnline; /** * @author Ali KIZIL * Starts MSP RMI Server * * Usage: * cd C:\Dev\eclipse\workspace\MATLABServerPages\.deployables\MATLABServerPages\WEB-INF\classes * java -classpath "c:\Program Files\Apache Software Foundation\Tomcat 5.5\common\lib\jsp-api.jar";c:\Dev\eclipse\workspace\MATLABServerPages\.deployables\MATLABServerPages\WEB-INF\classes rmi.goOnlineServer localhost 1099 * */ public class goOnlineServer { public goOnlineServer(String host, String port) { try { // Creates a goOnline RMI Server for Remote Usage // RMI protocol, User specified Host and Port goOnline goOnline = new goOnline(); LocateRegistry.createRegistry(Integer.parseInt(port)); Naming.rebind("rmi://" + host + ":" + port + "/msp",goOnline); System.out.println("MSP RMI Server is started"); } catch (RemoteException e) { System.out.println("MSP Error: "+e.getMessage()); } catch (MalformedURLException e) { System.out.println("MSP Error: "+e.getMessage()); } } public static void main(String[] args) { new goOnlineServer(args[0], args[1]); } }