INT-1614 refactoring FTP for Session and SessionFactory

This commit is contained in:
Mark Fisher
2010-11-19 18:03:46 -05:00
parent 9596777724
commit 66e64979ef
13 changed files with 64 additions and 22 deletions

View File

@@ -33,6 +33,7 @@ import org.springframework.util.Assert;
*
* @author Josh Long
* @author Oleg Zhurakousky
* @author Mark Fisher
* @since 2.0
*/
public class CachingSessionFactory implements SessionFactory, DisposableBean {
@@ -70,7 +71,7 @@ public class CachingSessionFactory implements SessionFactory, DisposableBean {
if (null == session) {
session = sessionFactory.getSession();
}
return (session != null) ? new PooledSftpSession(session) : null;
return (session != null) ? new CachedSession(session) : null;
}
finally {
this.lock.unlock();
@@ -99,11 +100,11 @@ public class CachingSessionFactory implements SessionFactory, DisposableBean {
}
private class PooledSftpSession implements Session {
private class CachedSession implements Session {
private final Session targetSession;
private PooledSftpSession(Session targetSession) {
private CachedSession(Session targetSession) {
this.targetSession = targetSession;
}