/** * Stops all {@link Server}s in reverse dependency order. If A depends on B, B is stopped * before A. */ public void stop() throws IOException { for (T server : Lists.reverse(getServers())) { server.stop(); } }
/** * Starts all {@link Server}s in dependency order. If A depends on B, A is started before B. * * If a {@link Server} fails to start, already-started {@link Server}s will be stopped. * * @param options the start options */ public void start(U options) throws IOException { List<T> servers = new ArrayList<>(); for (T server : getServers()) { try { server.start(options); servers.add(server); } catch (IOException e) { for (T started : servers) { started.stop(); } throw e; } } }
/** * Stops all {@link Server}s in reverse dependency order. If A depends on B, B is stopped * before A. */ public void stop() throws IOException { for (T server : Lists.reverse(getServers())) { server.stop(); } }
/** * Starts all {@link Server}s in dependency order. If A depends on B, A is started before B. * * If a {@link Server} fails to start, already-started {@link Server}s will be stopped. * * @param options the start options */ public void start(U options) throws IOException { List<T> servers = new ArrayList<>(); for (T server : getServers()) { try { server.start(options); servers.add(server); } catch (IOException e) { for (T started : servers) { started.stop(); } throw e; } } }