org.springframework.jms.listener.serversession
Class SimpleServerSessionFactory

java.lang.Object
  extended by org.springframework.jms.listener.serversession.SimpleServerSessionFactory
All Implemented Interfaces:
ServerSessionFactory

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

public class SimpleServerSessionFactory
extends Object
implements ServerSessionFactory

The simplest possible implementation of the ServerSessionFactory SPI: creating a new ServerSession with a new JMS Session every time. This is the default used by ServerSessionMessageListenerContainer.

The execution of a ServerSession (and its MessageListener) gets delegated to a TaskExecutor. By default, a SimpleAsyncTaskExecutor will be used, creating a new Thread for every execution attempt. Alternatives are a TimerTaskExecutor, sharing a single Thread for the execution of all ServerSessions, or a TaskExecutor implementation backed by a thread pool.

To reuse JMS Sessions and/or to limit the number of concurrent ServerSession executions, consider using a pooling ServerSessionFactory: for example, CommonsPoolServerSessionFactory.

Since:
2.0
Author:
Juergen Hoeller
See Also:
TaskExecutor, SimpleAsyncTaskExecutor, TimerTaskExecutor, CommonsPoolServerSessionFactory, ServerSessionMessageListenerContainer

Field Summary
static String DEFAULT_THREAD_NAME_PREFIX
          Deprecated. Default thread name prefix: "SimpleServerSessionFactory-".
 
Constructor Summary
SimpleServerSessionFactory()
          Deprecated.  
 
Method Summary
 void close(ListenerSessionManager sessionManager)
          Deprecated. This implementation is empty, as there is no state held for each ListenerSessionManager.
 ServerSession getServerSession(ListenerSessionManager sessionManager)
          Deprecated. Creates a new SimpleServerSession with a new JMS Session for every call.
protected  TaskExecutor getTaskExecutor()
          Deprecated. Return the TaskExecutor to use for executing ServerSessions.
 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
 

Field Detail

DEFAULT_THREAD_NAME_PREFIX

public static final String DEFAULT_THREAD_NAME_PREFIX
Deprecated. 
Default thread name prefix: "SimpleServerSessionFactory-".

Constructor Detail

SimpleServerSessionFactory

public SimpleServerSessionFactory()
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 SimpleAsyncTaskExecutor, creating a new Thread for every execution attempt. Alternatives are a TimerTaskExecutor, sharing a single Thread for the execution of all ServerSessions, or a TaskExecutor implementation backed by a thread pool.

See Also:
SimpleAsyncTaskExecutor, TimerTaskExecutor

getTaskExecutor

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


getServerSession

public ServerSession getServerSession(ListenerSessionManager sessionManager)
                               throws JMSException
Deprecated. 
Creates a new SimpleServerSession with a new JMS Session for every call.

Specified by:
getServerSession in interface ServerSessionFactory
Parameters:
sessionManager - the session manager to use for creating and executing new listener sessions (implicitly indicating the target listener to invoke)
Returns:
the JMS ServerSession
Throws:
JMSException - if retrieval failed

close

public void close(ListenerSessionManager sessionManager)
Deprecated. 
This implementation is empty, as there is no state held for each ListenerSessionManager.

Specified by:
close in interface ServerSessionFactory
Parameters:
sessionManager - the session manager used for creating and executing new listener sessions (implicitly indicating the target listener)


Copyright © 2002-2008 The Spring Framework.