|
Spring Integration | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.integration.file.remote.session.CachingSessionFactory<F>
public class CachingSessionFactory<F>
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.
Constructor Summary | |
---|---|
CachingSessionFactory(SessionFactory<F> sessionFactory)
Create a CachingSessionFactory with an unlimited number of sessions. |
|
CachingSessionFactory(SessionFactory<F> sessionFactory,
int sessionCacheSize)
Create a CachingSessionFactory with the specified session limit. |
Method Summary | |
---|---|
void |
destroy()
Remove (close) any unused sessions in the pool. |
Session<F> |
getSession()
Get a session from the pool (or block if none available). |
void |
setPoolSize(int poolSize)
Modify the target session pool size; the actual pool size will adjust up/down to this size as and when sessions are requested or retrieved. |
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 |
---|
public CachingSessionFactory(SessionFactory<F> sessionFactory)
sessionFactory
- the underlying session factory.public CachingSessionFactory(SessionFactory<F> sessionFactory, int sessionCacheSize)
sessionFactory
- the underlying session factory.sessionCacheSize
- the maximum cache size.setSessionWaitTimeout(long)
,
setPoolSize(int)
Method Detail |
---|
public void setSessionWaitTimeout(long sessionWaitTimeout)
java.lang.IllegalStateException
- if the wait expires prior to a Session becoming available.public void setPoolSize(int poolSize)
public Session<F> getSession()
getSession
in interface SessionFactory<F>
public void destroy()
destroy
in interface org.springframework.beans.factory.DisposableBean
|
Spring Integration | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |