package com.dwave.rmi; /* * DWaveRMIServer * * Copyright (C) 2000 D-Wave Systems Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ import java.rmi.server.UnicastRemoteObject; import java.rmi.RemoteException; import java.rmi.RMISecurityManager; import java.rmi.registry.*; import com.dwave.rmi.ssl.*; /** * DWaveRMIServer * * @author Michael Coury * @version 1.0, 10/06/2000 */ public class DWaveRMIServer extends UnicastRemoteObject implements DWaveRMIInterface { public DWaveRMIServer(int aPort) throws RemoteException { super(aPort, new RMISSLClientSocketFactory(), new RMISSLServerSocketFactory()); System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.www.protocol"); java.security.Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); } public static void main(String args[]) { int servicePort = 36251; // initial port number to increment from for rmi services Registry reg; DWaveRMIServer theServer; if(args.length < 1) { System.out.println("Usage: DWaveRMIServer "); System.exit(0); } String[] rmiService = new String[args.length]; for (int i =0; i< args.length;i++) rmiService[i] = args[i]; System.setSecurityManager(new RMISecurityManager()); try{ System.out.println("RMI: Creating registry....."); reg = LocateRegistry.createRegistry(1099, new RMISSLClientSocketFactory(), new RMISSLServerSocketFactory()); System.out.println("RMI: Registry created. Binding server....."); for(int i=0; i