public void disconnectController() { delegate.disconnectController(); }
@Override public void disconnectController() { wrapped.disconnectController(); }
@Override public void disconnectController() { wrapped.disconnectController(); }
public void disconnectController() { delegate.disconnectController(); }
@Override protected void doHandle(CommandContext ctx) throws CommandLineException { EmbeddedProcessLaunch serverLaunch = serverReference.get(); if (serverLaunch != null) { ctx.disconnectController(); } }
@Override protected void doHandle(CommandContext ctx) throws CommandLineException { EmbeddedProcessLaunch hostControllerLaunch = hostControllerReference.get(); if (hostControllerLaunch != null) { ctx.disconnectController(); } }
@Override protected void doHandle(CommandContext ctx) throws CommandLineException { EmbeddedProcessLaunch serverLaunch = serverReference.get(); if (serverLaunch != null) { ctx.disconnectController(); } }
@Override protected void doHandle(CommandContext ctx) throws CommandLineException { EmbeddedProcessLaunch hostControllerLaunch = hostControllerReference.get(); if (hostControllerLaunch != null) { ctx.disconnectController(); } }
@Override public void reconnect(int timeoutInSeconds) throws TimeoutException, InterruptedException { if (options.isWrappedClient) { throw new UnsupportedOperationException("Can't reconnect a wrapped client"); } log.info("Reconnecting the client"); try { client.close(); cliContext.disconnectController(); } catch (Throwable ignored) { } long endTime = System.currentTimeMillis() + TimeUnit.SECONDS.toMillis(timeoutInSeconds); while (System.currentTimeMillis() < endTime) { try { connect(); return; } catch (Throwable e) { log.info(e.getMessage()); // server is probably down, will retry } Thread.sleep(500); } throw new TimeoutException("Timeout reconnecting to server"); }
@Override public void close() throws IOException { client.close(); cliContext.disconnectController(); if (closedAt == null) { closedAt = new ThisIsWhereTheClientWasClosed(); } } }
private void reconnect(CommandContext ctx) throws CommandLineException { if (isEmbedded()) { return; } final long start = System.currentTimeMillis(); final long timeoutMillis = ctx.getConfig().getConnectionTimeout() + 1000; Exception exception; while (true) { try { ctx.connectController(); break; } catch (Exception ex) { // Ignore and try again exception = ex; } if (System.currentTimeMillis() - start > timeoutMillis) { ctx.disconnectController(); throw new CommandLineException("Failed to re-establish connection in " + (System.currentTimeMillis() - start) + "ms." + (exception != null ? exception : "")); } try { Thread.sleep(50); } catch (InterruptedException e) { ctx.disconnectController(); throw new CommandLineException("Interrupted while pausing before reconnecting.", e); } } }
private void reconnect(CommandContext ctx) throws CommandLineException { if (isEmbedded()) { return; } final long start = System.currentTimeMillis(); final long timeoutMillis = ctx.getConfig().getConnectionTimeout() + 1000; Exception exception; while (true) { try { ctx.connectController(); break; } catch (Exception ex) { // Ignore and try again exception = ex; } if (System.currentTimeMillis() - start > timeoutMillis) { ctx.disconnectController(); throw new CommandLineException("Failed to re-establish connection in " + (System.currentTimeMillis() - start) + "ms." + (exception != null ? exception : "")); } try { Thread.sleep(50); } catch (InterruptedException e) { ctx.disconnectController(); throw new CommandLineException("Interrupted while pausing before reconnecting.", e); } } }
ctx.disconnectController(); throw new CommandLineException("Failed to establish connection in " + (System.currentTimeMillis() - start) + "ms"); Thread.sleep(50); } catch (InterruptedException e) { ctx.disconnectController(); throw new CommandLineException("Interrupted while pausing before reconnecting.", e);
ctx.disconnectController(); throw new CommandLineException("Failed to establish connection in " + (System.currentTimeMillis() - start) + "ms"); Thread.sleep(50); } catch (InterruptedException e) { ctx.disconnectController(); throw new CommandLineException("Interrupted while pausing before reconnecting.", e);
try { client.close(); cliContext.disconnectController(); } catch (IOException ignored) {
} finally { if (!ok) { ctx.disconnectController(); restorer.restoreEnvironment(); } else if (contextSelector != null) {
ctx.disconnectController(); } else { cliClient.ensureConnected(ctx.getConfig().getConnectionTimeout() + 1000); } catch(CommandLineException e) { ctx.disconnectController(); throw e; } catch (IOException ex) {
ctx.disconnectController(); } else { cliClient.ensureConnected(ctx.getConfig().getConnectionTimeout() + 1000); } catch(CommandLineException e) { ctx.disconnectController(); throw e; } catch (IOException ex) {
} catch (IOException e) { if (e.getCause() != null && !(e.getCause() instanceof InterruptedException)) { ctx.disconnectController();
} catch (IOException e) { if (e.getCause() != null && !(e.getCause() instanceof InterruptedException)) { ctx.disconnectController();