Spring Integration

org.springframework.integration.file.remote.session
Class CachingSessionFactory<F>

java.lang.Object
  extended by org.springframework.integration.file.remote.session.CachingSessionFactory<F>
All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean, SessionFactory<F>

public class CachingSessionFactory<F>
extends java.lang.Object
implements SessionFactory<F>, org.springframework.beans.factory.DisposableBean

A SessionFactory implementation that caches Sessions for reuse without requiring reconnection each time the Session is retrieved from the factory. This implementation wraps and delegates to a target SessionFactory instance.

Since:
2.0
Author:
Josh Long, Oleg Zhurakousky, Mark Fisher, Gary Russell

Constructor Summary
CachingSessionFactory(SessionFactory<F> sessionFactory)
           
CachingSessionFactory(SessionFactory<F> sessionFactory, int sessionCacheSize)
           
 
Method Summary
 void destroy()
           
 Session<F> getSession()
           
 void setPoolSize(int poolSize)
           
 void setSessionWaitTimeout(long sessionWaitTimeout)
          Sets the limit of how long to wait for a session to become available.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachingSessionFactory

public CachingSessionFactory(SessionFactory<F> sessionFactory)

CachingSessionFactory

public CachingSessionFactory(SessionFactory<F> sessionFactory,
                             int sessionCacheSize)
Method Detail

setSessionWaitTimeout

public void setSessionWaitTimeout(long sessionWaitTimeout)
Sets the limit of how long to wait for a session to become available.

Throws:
{@link - IllegalStateException} if the wait expires prior to a Session becoming available.

setPoolSize

public void setPoolSize(int poolSize)

getSession

public Session<F> getSession()
Specified by:
getSession in interface SessionFactory<F>

destroy

public void destroy()
Specified by:
destroy in interface org.springframework.beans.factory.DisposableBean

Spring Integration