/** Reloads the server. In domain, reloads the entire host, which includes restarting all its servers. */ public final void reload() throws IOException, InterruptedException, TimeoutException { ops.reload(); }
/** * Reloads the server if required. In domain, reloads the entire host if at least one server requires reload. * Reloading the host includes restarting all its servers. * @return if the server was in fact reloaded; in domain, if the host was reloaded */ public final boolean reloadIfRequired() throws IOException, InterruptedException, TimeoutException { return ops.reloadIfRequired(); }
/** Restarts the server. In domain, restarts the entire host. */ public final void restart() throws IOException, InterruptedException, TimeoutException { ops.restart(); }
/** Shuts down the server. In domain, shuts down the entire host. */ public final void shutdown() throws IOException { ops.shutdown(0); }
/** * Restarts the server if required. In domain, restarts the entire host if at least one server requires restart. * @return if the server was in fact restarted; in domain, if the host was restarted */ public final boolean restartIfRequired() throws IOException, InterruptedException, TimeoutException { return ops.restartIfRequired(); }
/** * Returns whether reload is required. In domain, returns {@code true} if at least one of the servers * requires reload. */ public final boolean isReloadRequired() { try { return ops.isReloadRequired(); } catch (IOException e) { throw sneakyThrow(e); } }
/** * Returns whether restart is required. In domain, returns {@code true} if at least one of the servers * requires restart. */ public final boolean isRestartRequired() { try { return ops.isRestartRequired(); } catch (IOException e) { throw sneakyThrow(e); } }
/** * Waits until the server is {@code running}. In domain, only waits for the host controller, * not for individual servers. */ public final void waitUntilRunning() { try { ops.waitUntilRunning(); } catch (InterruptedException e) { throw sneakyThrow(e); } catch (IOException e) { throw sneakyThrow(e); } catch (TimeoutException e) { throw sneakyThrow(e); } }
/** * Shuts down the server gracefully. That is, the server will wait up to {@code timeoutInSeconds} for all active * requests to finish. In domain, all servers on the host are shut down gracefully and then the host itself * is shut down (there's no such thing as graceful shutdown of a host controller). * * @param timeoutInSeconds if {@code == 0}, then the server will shutdown immediately without waiting * for the active requests to finish; if {@code <= 0}, then the server will wait indefinitely for the active * requests to finish */ public final void shutdownGracefully(int timeoutInSeconds) throws IOException { client.version().assertAtLeast(ServerVersion.VERSION_3_0_0, "Graceful shutdown is only supported since WildFly 9"); ops.shutdown(timeoutInSeconds); }