@Override public ServerVersion version() throws IOException { return delegate.version(); }
@Override public ServerVersion version() throws IOException { ensureInitialized(); return delegate.version(); }
public ReloadToSnapshot(OnlineManagementClient client, String snapshot, int timeoutInSeconds) throws IOException { if (client.version().lessThan(ServerVersion.VERSION_5_0_0)) { throw new IllegalStateException("ReloadToSnapshot requires at least WildFly Core 3."); } this.client = client; this.snapshot = snapshot; this.timeoutInSeconds = timeoutInSeconds; }
public ReloadToOriginal(OnlineManagementClient client, int timeoutInSeconds) throws IOException { if (!client.options().isStandalone) { throw new IllegalStateException("ReloadToOriginal is only supported for a standalone server"); } if (client.version().lessThan(ServerVersion.VERSION_1_4_0)) { throw new IllegalStateException("ReloadToOriginal requires at least JBoss AS 7.2.0 (EAP 6.1.0)"); } this.client = client; this.timeoutInSeconds = timeoutInSeconds; }
/** * Shuts down given {@code host} gracefully. This is a variant of {@link Administration#shutdownGracefully(int)}. * * @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 void shutdownGracefully(String host, int timeoutInSeconds) throws IOException, InterruptedException, TimeoutException { client.version().assertAtLeast(ServerVersion.VERSION_3_0_0, "Graceful shutdown is only supported since WildFly 9"); domainOps.shutdown(host, timeoutInSeconds); }
/** * 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); }
void shutdownServersGracefully(String host, List<String> servers, int timeoutInSeconds) throws IOException, InterruptedException, TimeoutException { client.version().assertAtLeast(ServerVersion.VERSION_3_0_0, "Graceful shutdown is only supported since WildFly 9"); Batch batch = new Batch(); for (String server : servers) { batch.invoke(Constants.STOP, Address.host(host).and(Constants.SERVER_CONFIG, server), Values.of(Constants.TIMEOUT, timeoutInSeconds)); } ops.batch(batch); }