public override void Terminate() { Trace.WriteLine("[SftpTransmitterAdapter] Adapter Terminates..."); try { SftpConnectionPool.Dispose(); base.Terminate(); } catch (Exception ex) { ExceptionHandling.HandleComponentException(System.Reflection.MethodBase.GetCurrentMethod(), ex); } Trace.WriteLine("[SftpTransmitterAdapter] Adapter Terminated"); }
/// <summary> /// Implementation for AsyncTransmitterEndpoint::ProcessMessage /// Transmit the message and optionally moves the file from RemoteTempDir to RemotePath /// </summary> /// <param name="message"></param> /// <returns></returns> public override IBaseMessage ProcessMessage(IBaseMessage message) { this._properties = new SftpTransmitProperties(message, _propertyNamespace); ISftp sftp = SftpConnectionPool.GetHostByName(this._properties).GetConnection(this._properties, this._shutdownRequested); try { if (!this._shutdownRequested) { ProcessMessageInternal(message, sftp); } } catch (Exception ex) { //CheckErrorThreshold(); TraceMessage("[SftpTransmitterEndpoint] Exception: " + ex.Message); throw ExceptionHandling.HandleComponentException(System.Reflection.MethodBase.GetCurrentMethod(), ex); } finally { SftpConnectionPool.GetHostByName(this._properties).ReleaseConnection(sftp); } return(null); }
void sftp_OnDisconnect(ISftp sftp) { SftpConnectionPool.GetHostByName(this._properties).ReleaseConnection(sftp); }