public void disconnect() { if (_session != null) { _session.close(); } SSHCmdHelper.releaseSshConnection(_connection); }
} finally { if (sshSession != null) sshSession.close();
} finally { if (sess != null) sess.close();
session.close(); if ( log.isDebug() ) { logDebug( BaseMessages.getString( PKG, "SSH.Log.SessionClosed" ) );
@Override public void destroy() { s.close(); } };
/** * Close this SFTP session. NEVER forget to call this method to free up * resources - even if you got an exception from one of the other methods. * Sometimes these other methods may throw an exception, saying that the * underlying channel is closed (this can happen, e.g., if the other server * sent a close message.) However, as long as you have not called the * <code>close()</code> method, you are likely wasting resources. * */ public void close() { sess.close(); }
/** * Close this SFTP session. NEVER forget to call this method to free up * resources - even if you got an exception from one of the other methods. * Sometimes these other methods may throw an exception, saying that the * underlying channel is closed (this can happen, e.g., if the other server * sent a close message.) However, as long as you have not called the * <code>close()</code> method, you are likely wasting resources. * */ public void close() { sess.close(); }
/** * Close this SFTP session. NEVER forget to call this method to free up * resources - even if you got an exception from one of the other methods. * Sometimes these other methods may throw an exception, saying that the * underlying channel is closed (this can happen, e.g., if the other server * sent a close message.) However, as long as you have not called the * <code>close()</code> method, you are likely wasting resources. * */ public void close() { sess.close(); }
public void kill() throws IOException, InterruptedException { t1.interrupt(); t2.interrupt(); t3.interrupt(); session.close(); }
public void kill() throws IOException, InterruptedException { t1.interrupt(); t2.interrupt(); t3.interrupt(); session.close(); }
public void close() { if (stdout != null) { try { stdout.close(); stderr.close(); } catch (IOException e) { log.error(String.format("RemoteClientStream Close session stdout %s failed!", ip), e); } } if (session != null) { session.close(); } }
@Override public void onClosed(Channel channel, IOException cause) { sess.close(); conn.close(); } });
@Override public void onClosed(Channel channel, IOException cause) { sess.close(); conn.close(); } });
public int join() throws IOException, InterruptedException { try { t1.join(); t2.join(); t3.join(); session.waitForCondition(ChannelCondition.EXIT_STATUS,0); Integer r = session.getExitStatus(); if(r!=null) return r; return -1; } finally { session.close(); } }
public int join() throws IOException, InterruptedException { try { t1.join(); t2.join(); t3.join(); session.waitForCondition(ChannelCondition.EXIT_STATUS,0); Integer r = session.getExitStatus(); if(r!=null) return r; return -1; } finally { session.close(); } }
public void close() { if (null != stdoutReader) { try { stdoutReader.close(); } catch (IOException e) { } } if (null != stderrReader) { try { stderrReader.close(); } catch (IOException e) { } } if (null != out) { out.close(); } if (null != session) { session.close(); } if (null != conn) { conn.close(); } }
public int executeRemoteCommand(String cmd, OutputStream os) { Session session = null; try { session = connection.openSession(); int status = connection.exec(cmd, os); if (status != 0) { throw new RuntimeException("Failed to execute command: " + cmd + ", exit code = " + status); } return status; } catch (InterruptedException | IOException e) { throw new AssertionError(e); } finally { if (session != null) { session.close(); } } }
public void close() { mySession.close(); waitForCondition(ChannelCondition.CLOSED, 0); myOwner.sessionClosed(this); }
@Override public void execCmd(RemoteCmd cmd) { List<String> cmds = cmd.getCmds(); String ip = remoteCmdClientConfig.getIp(); Session session = null; for (String commandLine : cmds) { try { session = connection.openSession(); session.execCommand(commandLine); } catch (IOException e) { log.error(String.format("Close session %s failed!", ip)); } finally { if (session != null) { session.close(); } } } }
public boolean closeSession(Session session) { lock(Thread.currentThread()); try { if (session == null) { return false; } try { session.close(); session.waitForCondition(ChannelCondition.CLOSED, 0); } finally { mySessionCount--; SVNDebugLog.getDefaultLog().logFine(SVNLogType.NETWORK, ourRequestor + ": SESSION CLOSED: " + this + "." + mySessionCount); } if (mySessionCount <= 0) { mySessionCount = 0; } return mySessionCount <= 0; } finally { unlock(); } }