org.springframework.integration.sftp.session
Class QueuedSftpSessionPool

java.lang.Object
  extended by org.springframework.integration.sftp.session.QueuedSftpSessionPool
All Implemented Interfaces:
InitializingBean, SftpSessionPool

public class QueuedSftpSessionPool
extends java.lang.Object
implements SftpSessionPool, InitializingBean

This approach - of having a SessionPool (SftpSessionPool) that has an implementation of Queued*SessionPool (QueuedSftpSessionPool) - was taken almost directly from the Spring Integration FTP adapter.

Since:
2.0

Field Summary
static int DEFAULT_POOL_SIZE
           
 
Constructor Summary
QueuedSftpSessionPool(int maxPoolSize, SftpSessionFactoryBean sessionFactory)
           
QueuedSftpSessionPool(SftpSessionFactoryBean factory)
           
 
Method Summary
 void afterPropertiesSet()
           
 SftpSession getSession()
          Returns a session that can be used to connect to an sftp instance and perform operations
 void release(SftpSession session)
          Releases the session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_POOL_SIZE

public static final int DEFAULT_POOL_SIZE
See Also:
Constant Field Values
Constructor Detail

QueuedSftpSessionPool

public QueuedSftpSessionPool(SftpSessionFactoryBean factory)

QueuedSftpSessionPool

public QueuedSftpSessionPool(int maxPoolSize,
                             SftpSessionFactoryBean sessionFactory)
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
java.lang.Exception

getSession

public SftpSession getSession()
                       throws java.lang.Exception
Description copied from interface: SftpSessionPool
Returns a session that can be used to connect to an sftp instance and perform operations

Specified by:
getSession in interface SftpSessionPool
Returns:
the session from the pool ready to be connected to.
Throws:
java.lang.Exception - if any fault occurs when trying to connect to the remote server

release

public void release(SftpSession session)
Description copied from interface: SftpSessionPool
Releases the session.

Specified by:
release in interface SftpSessionPool
Parameters:
session - the session to relinquish / renew