public void start() throws IOException { super.start(); if (isPrimaryServer) { List connectHomes = getConnectHomes(); List homes = getHomes(); if (connectHomes.size() != homes.size()) throw new IOException("number of connect homes and bind homes must match in RMI transport"); Home bindHome = (Home) homes.get(0); Home connectHome = (Home) connectHomes.get(0); initRMI(bindHome, connectHome); for (int i = 1; i < homes.size(); i++) { bindHome = (Home) homes.get(i); connectHome = (Home) connectHomes.get(i); RMIServerInvoker copy = copy(); secondaryServers.add(copy); copy.initRMI(bindHome, connectHome); } } }
if(!serverInvoker.isStarted()) serverInvoker.start();
invoker.start();