The Spring Framework

org.springframework.jms.listener.serversession
Class AbstractPoolingServerSessionFactory

java.lang.Object
  extended by org.springframework.jms.listener.serversession.AbstractPoolingServerSessionFactory
All Implemented Interfaces:
ServerSessionFactory
Direct Known Subclasses:
CommonsPoolServerSessionFactory

Deprecated. as of Spring 2.5, in favor of DefaultMessageListenerContainer and JmsMessageEndpointManager. To be removed in Spring 3.0.

public abstract class AbstractPoolingServerSessionFactory
extends Object
implements ServerSessionFactory

Abstract base class for ServerSessionFactory implementations that pool ServerSessionFactory instances.

Provides a factory method that creates a poolable ServerSession (to be added as new instance to a pool), a callback method invoked when a ServerSession finished an execution of its listener (to return an instance to the pool), and a method to destroy a ServerSession instance (after removing an instance from the pool).

Since:
2.0
Author:
Juergen Hoeller
See Also:
CommonsPoolServerSessionFactory

Field Summary
protected  Log logger
          Deprecated.  
 
Constructor Summary
AbstractPoolingServerSessionFactory()
          Deprecated.  
 
Method Summary
protected  ServerSession createServerSession(ListenerSessionManager sessionManager)
          Deprecated. Create a new poolable ServerSession.
protected  void destroyServerSession(ServerSession serverSession)
          Deprecated. Destroy the given poolable ServerSession.
 int getMaxSize()
          Deprecated. Return the maximum size of the pool.
protected  TaskExecutor getTaskExecutor()
          Deprecated. Return the TaskExecutor to use for executing ServerSessions.
protected abstract  void serverSessionFinished(ServerSession serverSession, ListenerSessionManager sessionManager)
          Deprecated. Template method called by a ServerSession if it finished execution of its listener and is ready to go back into the pool.
 void setMaxSize(int maxSize)
          Deprecated. Set the maximum size of the pool.
 void setTaskExecutor(TaskExecutor taskExecutor)
          Deprecated. Specify the TaskExecutor to use for executing ServerSessions (and consequently, the underlying MessageListener).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.jms.listener.serversession.ServerSessionFactory
close, getServerSession
 

Field Detail

logger

protected final Log logger
Deprecated. 
Constructor Detail

AbstractPoolingServerSessionFactory

public AbstractPoolingServerSessionFactory()
Deprecated. 
Method Detail

setTaskExecutor

public void setTaskExecutor(TaskExecutor taskExecutor)
Deprecated. 
Specify the TaskExecutor to use for executing ServerSessions (and consequently, the underlying MessageListener).

Default is a TimerTaskExecutor for each pooled ServerSession, using one Thread per pooled JMS Session. Alternatives are a shared TimerTaskExecutor, sharing a single Thread for the execution of all ServerSessions, or a TaskExecutor implementation backed by a thread pool.


getTaskExecutor

protected TaskExecutor getTaskExecutor()
Deprecated. 
Return the TaskExecutor to use for executing ServerSessions.


setMaxSize

public void setMaxSize(int maxSize)
Deprecated. 
Set the maximum size of the pool.


getMaxSize

public int getMaxSize()
Deprecated. 
Return the maximum size of the pool.


createServerSession

protected final ServerSession createServerSession(ListenerSessionManager sessionManager)
                                           throws JMSException
Deprecated. 
Create a new poolable ServerSession. To be called when a new instance should be added to the pool.

Parameters:
sessionManager - the listener session manager to create the poolable ServerSession for
Returns:
the new poolable ServerSession
Throws:
JMSException - if creation failed

destroyServerSession

protected final void destroyServerSession(ServerSession serverSession)
Deprecated. 
Destroy the given poolable ServerSession. To be called when an instance got removed from the pool.

Parameters:
serverSession - the poolable ServerSession to destroy

serverSessionFinished

protected abstract void serverSessionFinished(ServerSession serverSession,
                                              ListenerSessionManager sessionManager)
Deprecated. 
Template method called by a ServerSession if it finished execution of its listener and is ready to go back into the pool.

Subclasses should implement the actual returning of the instance to the pool.

Parameters:
serverSession - the ServerSession that finished its execution
sessionManager - the session manager that the ServerSession belongs to

The Spring Framework

Copyright © 2002-2008 The Spring Framework.