return pool;
}
protected GenericObjectPool createPool(FtpConnectionFactory connectionFactory)
{
GenericObjectPool genericPool = new GenericObjectPool(connectionFactory);
byte poolExhaustedAction = ThreadingProfile.DEFAULT_POOL_EXHAUST_ACTION;
ThreadingProfile receiverThreadingProfile = this.getReceiverThreadingProfile();
if (receiverThreadingProfile != null)
{
int threadingProfilePoolExhaustedAction = receiverThreadingProfile.getPoolExhaustedAction();
if (threadingProfilePoolExhaustedAction == ThreadingProfile.WHEN_EXHAUSTED_WAIT)
{
poolExhaustedAction = GenericObjectPool.WHEN_EXHAUSTED_BLOCK;
}
else if (threadingProfilePoolExhaustedAction == ThreadingProfile.WHEN_EXHAUSTED_ABORT)
{
poolExhaustedAction = GenericObjectPool.WHEN_EXHAUSTED_FAIL;
}
else if (threadingProfilePoolExhaustedAction == ThreadingProfile.WHEN_EXHAUSTED_RUN)
{
poolExhaustedAction = GenericObjectPool.WHEN_EXHAUSTED_GROW;
}
}
genericPool.setWhenExhaustedAction(poolExhaustedAction);
genericPool.setTestOnBorrow(isValidateConnections());
return genericPool;
}