@Override public void shutdown() { exited.set(true); callback.onExit(0); super.shutdown(); } };
callback.onExit(0);
callback.onExit(exitStatus, exitMsg);
public void destroy() { if (!closed) { closed = true; flush(out, err); close(in, out, err); callback.onExit(0); } }
/** * Informs the SSH server that the shell has exited * * @param exitValue the exit value */ default void onExit(int exitValue) { onExit(exitValue, ""); }
/** * Informs the SSH server that the shell has exited * * @param exitValue the exit value */ default void onExit(int exitValue) { onExit(exitValue, ""); }
@Override public void onExit(int rc, String exitMessage) { exit.onExit(translateExit(rc), exitMessage); log(rc); }
@Override public void run() { try { consoleSession.doSession(in, out); } catch (StopException s) { // exit normally } catch (Throwable t) { t.printStackTrace(); } cbk.onExit(0); } }, session.getUsername(), session.getAttribute(SshdServer.CREDENTIAL).getValue());
private void quit(int exitCode) { SshContext ctx = THREAD_CONTEXT.get(); if (ctx != null) { ctx.getExitCallback().onExit(exitCode); } }
public void doExit(final int exitValue, final String exitMessage) { doClose(); if (callback != null) { callback.onExit(exitValue, exitMessage); } }
@SuppressWarnings("synthetic-access") @Override public void operationComplete(CloseFuture future) { callback.onExit(0); } });
public void destroy() { if (!closed) { closed = true; flush(out, err); close(in, out, err); callback.onExit(0); } }
@Override public void shutdown() { exited.set(true); callback.onExit(0); super.shutdown(); } };
@SuppressWarnings("synthetic-access") @Override public void operationComplete(CloseFuture future) { callback.onExit(0); } });
@SuppressWarnings("synthetic-access") @Override public void operationComplete(CloseFuture future) { callback.onExit(0); } });
@Override public void shutdown() { exited.set(true); callback.onExit(0); super.shutdown(); } };
/** * Stops the command from running. * * @param exitCode the exitCode to return to the client. */ public synchronized void stop(int exitCode) { exitCallback.onExit(exitCode); }
private void close(int exit) throws IOException { ioOut.close(false).addListener(future -> { exitCallback.onExit(exit); if (closed.compareAndSet(false, true)) { if (closeHandler != null) { closeHandler.accept(null); } else { // This happen : report it to the SSHD project } } }); }
@Override public void start(final Environment env) throws IOException { new LengthOf( new TeeInput(this.command, new OutputTo(this.output)) ).value(); this.callback.onExit(0); }
@Override public void start(final Environment env) throws IOException { new LengthOf( new TeeInput(this.command, new OutputTo(this.output)) ).value(); this.callback.onExit(0); }