|
Spring Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.integration.ftp.QueuedFtpClientPool
public class QueuedFtpClientPool
FtpClientPool implementation based on a Queue. This implementation has a default pool size of 5, but this is configurable with a constructor argument.
This implementation pools released clients, but gives no guarantee to the number of clients open at the same time.
Constructor Summary | |
---|---|
QueuedFtpClientPool(FtpClientFactory factory)
|
|
QueuedFtpClientPool(int maxPoolSize,
FtpClientFactory factory)
|
Method Summary | |
---|---|
org.apache.commons.net.ftp.FTPClient |
getClient()
Returns an active FTPClient connected to the configured server. |
protected org.apache.commons.net.ftp.FTPClient |
prepareClient(org.apache.commons.net.ftp.FTPClient client)
Prepares the client before it is returned through getClient() . |
void |
releaseClient(org.apache.commons.net.ftp.FTPClient client)
Releases the client back to the pool. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public QueuedFtpClientPool(FtpClientFactory factory)
public QueuedFtpClientPool(int maxPoolSize, FtpClientFactory factory)
maxPoolSize
- the maximum size of the poolMethod Detail |
---|
public org.apache.commons.net.ftp.FTPClient getClient() throws SocketException, IOException
FTPClient.sendNoOp()
. In this case getClient is
called recursively to obtain a client that is still alive. For this
reason large pools are not recommended in poor networking conditions.
getClient
in interface FtpClientFactory
null
.
IOException
- thrown when a networking IO subsystem error occurs
SocketException
protected org.apache.commons.net.ftp.FTPClient prepareClient(org.apache.commons.net.ftp.FTPClient client) throws SocketException, IOException
getClient()
. The default implementation will check the
connection using a noOp and replace the client with a new one if it
encounters a problem.
In more exotic environments subclasses can override this method to
implement their own preparation strategy.
client
- the unprepared client
SocketException
IOException
public void releaseClient(org.apache.commons.net.ftp.FTPClient client)
FtpClientPool
releaseClient
in interface FtpClientPool
client
- the FTPClient
to release. Implementations of this
method are recommended to deal gracefully with a null
argument, although the endpoint implementations in
org.springframework.integration.ftp
will never pass in
null
.
|
Spring Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |