Spring Integration

org.springframework.integration.sftp
Class QueuedSftpSessionPool

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

public class QueuedSftpSessionPool
extends Object
implements SftpSessionPool, InitializingBean

This approach - of having a SessionPool (SftpSessionPool) that has an implementation of Queued*SessionPool (QueuedSftpSessionPool) - was taken pretty directly from the incredibly good Spring IntegrationFTP adapter.

Since:
2.0
Author:
Josh Long

Field Summary
static int DEFAULT_POOL_SIZE
           
 
Constructor Summary
QueuedSftpSessionPool(int maxPoolSize, SftpSessionFactory sessionFactory)
           
QueuedSftpSessionPool(SftpSessionFactory factory)
           
 
Method Summary
 void afterPropertiesSet()
           
 SftpSession getSession()
          this returns a session that can be used to connct to an sftp instance and perform operations
 void release(SftpSession session)
          Frees up the client.
 
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(SftpSessionFactory factory)

QueuedSftpSessionPool

public QueuedSftpSessionPool(int maxPoolSize,
                             SftpSessionFactory sessionFactory)
Method Detail

afterPropertiesSet

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

getSession

public SftpSession getSession()
                       throws Exception
Description copied from interface: SftpSessionPool
this returns a session that can be used to connct 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:
Exception - thrown if theres any of the numerous faults possible when trying to connect to the remote server

release

public void release(SftpSession session)
Description copied from interface: SftpSessionPool
Frees up the client. Im not sure what the meaningful semantics of this are. Perhaps it just calls (session ,channel).disconnect() ?

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

Spring Integration

Copyright © 2010. All Rights Reserved.