|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.jms.listener.serversession.AbstractPoolingServerSessionFactory org.springframework.jms.listener.serversession.CommonsPoolServerSessionFactory
public class CommonsPoolServerSessionFactory
ServerSessionFactory
implementation that holds JMS
ServerSessions
in a configurable Jakarta Commons Pool.
By default, an instance of GenericObjectPool
is created.
Subclasses may change the type of ObjectPool
used by
overriding the createObjectPool
method.
Provides many configuration properties mirroring those of the Commons Pool
GenericObjectPool
class; these properties are passed to the
GenericObjectPool
during construction. If creating a subclass of this
class to change the ObjectPool
implementation type, pass in the values
of configuration properties that are relevant to your chosen implementation.
GenericObjectPool
,
createObjectPool(org.springframework.jms.listener.serversession.ListenerSessionManager)
,
AbstractPoolingServerSessionFactory.setMaxSize(int)
,
setMaxIdle(int)
,
setMinIdle(int)
,
setMaxWait(long)
Field Summary |
---|
Fields inherited from class org.springframework.jms.listener.serversession.AbstractPoolingServerSessionFactory |
---|
logger |
Constructor Summary | |
---|---|
CommonsPoolServerSessionFactory()
Deprecated. Create a CommonsPoolServerSessionFactory with default settings. |
Method Summary | |
---|---|
void |
close(ListenerSessionManager sessionManager)
Deprecated. Closes and removes the pool for the given session manager. |
protected ObjectPool |
createObjectPool(ListenerSessionManager sessionManager)
Deprecated. Subclasses can override this if they want to return a specific Commons pool. |
protected PoolableObjectFactory |
createPoolableObjectFactory(ListenerSessionManager sessionManager)
Deprecated. Create a Commons PoolableObjectFactory adapter for the given session manager. |
int |
getMaxIdle()
Deprecated. Return the maximum number of idle ServerSessions in the pool. |
long |
getMaxWait()
Deprecated. Return the maximum waiting time for fetching a ServerSession from the pool. |
long |
getMinEvictableIdleTimeMillis()
Deprecated. Return the minimum time that an idle ServerSession can sit in the pool. |
int |
getMinIdle()
Deprecated. Return the minimum number of idle ServerSessions in the pool. |
ServerSession |
getServerSession(ListenerSessionManager sessionManager)
Deprecated. Returns a ServerSession from the pool, creating a new pool for the given session manager if necessary. |
long |
getTimeBetweenEvictionRunsMillis()
Deprecated. Return the time between eviction runs that check idle ServerSessions. |
protected void |
serverSessionFinished(ServerSession serverSession,
ListenerSessionManager sessionManager)
Deprecated. Returns the given ServerSession, which just finished an execution of its listener, back to the pool. |
void |
setMaxIdle(int maxIdle)
Deprecated. Set the maximum number of idle ServerSessions in the pool. |
void |
setMaxWait(long maxWait)
Deprecated. Set the maximum waiting time for fetching an ServerSession from the pool. |
void |
setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis)
Deprecated. Set the minimum time that an idle ServerSession can sit in the pool before it becomes subject to eviction. |
void |
setMinIdle(int minIdle)
Deprecated. Set the minimum number of idle ServerSessions in the pool. |
void |
setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis)
Deprecated. Set the time between eviction runs that check idle ServerSessions whether they have been idle for too long or have become invalid. |
Methods inherited from class org.springframework.jms.listener.serversession.AbstractPoolingServerSessionFactory |
---|
createServerSession, destroyServerSession, getMaxSize, getTaskExecutor, setMaxSize, setTaskExecutor |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CommonsPoolServerSessionFactory()
AbstractPoolingServerSessionFactory.setMaxSize(int)
,
GenericObjectPool.setMaxActive(int)
Method Detail |
---|
public void setMaxIdle(int maxIdle)
GenericObjectPool.setMaxIdle(int)
public int getMaxIdle()
public void setMinIdle(int minIdle)
GenericObjectPool.setMinIdle(int)
public int getMinIdle()
public void setMaxWait(long maxWait)
GenericObjectPool.setMaxWait(long)
public long getMaxWait()
public void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis)
GenericObjectPool.setTimeBetweenEvictionRunsMillis(long)
public long getTimeBetweenEvictionRunsMillis()
public void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis)
Note that eviction runs need to be performed to take this setting into effect.
setTimeBetweenEvictionRunsMillis(long)
,
GenericObjectPool.setMinEvictableIdleTimeMillis(long)
public long getMinEvictableIdleTimeMillis()
public ServerSession getServerSession(ListenerSessionManager sessionManager) throws JMSException
sessionManager
- the session manager to use for
creating and executing new listener sessions
(implicitly indicating the target listener to invoke)
JMSException
- if retrieval failedcreateObjectPool(org.springframework.jms.listener.serversession.ListenerSessionManager)
protected ObjectPool createObjectPool(ListenerSessionManager sessionManager)
Default is a GenericObjectPool instance with the given pool size.
sessionManager
- the session manager to use for
creating and executing new listener sessions
ObjectPool
.GenericObjectPool
,
AbstractPoolingServerSessionFactory.setMaxSize(int)
protected PoolableObjectFactory createPoolableObjectFactory(ListenerSessionManager sessionManager)
createServerSession
and destroyServerSession
as defined by the AbstractPoolingServerSessionFactory class.
sessionManager
- the session manager to use for
creating and executing new listener sessions
AbstractPoolingServerSessionFactory.createServerSession(org.springframework.jms.listener.serversession.ListenerSessionManager)
,
AbstractPoolingServerSessionFactory.destroyServerSession(javax.jms.ServerSession)
protected void serverSessionFinished(ServerSession serverSession, ListenerSessionManager sessionManager)
serverSessionFinished
in class AbstractPoolingServerSessionFactory
serverSession
- the ServerSession that finished its executionsessionManager
- the session manager that the ServerSession belongs topublic void close(ListenerSessionManager sessionManager)
sessionManager
- the session manager used for
creating and executing new listener sessions
(implicitly indicating the target listener)
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |