org.apache.commons.messenger
Class DefaultServerSessionPool

java.lang.Object
  extended by org.apache.commons.messenger.DefaultServerSessionPool
All Implemented Interfaces:
javax.jms.ServerSessionPool

public class DefaultServerSessionPool
extends java.lang.Object
implements javax.jms.ServerSessionPool

DefaultServerSessionPool is a default implementation of the JMS ServerSessionPool interface.

Version:
$Revision: 1.4 $
Author:
James Strachan

Field Summary
private  java.util.LinkedList list
          the list of ServerSession objects
private  javax.jms.MessageListener listener
          The MessageListener which are fired by new JMS Sessions
private  SessionFactory sessionFactory
          the factory used to create new Sessions
private  long timeout
          maximum blocking time, just in case a notify goes walkies
 
Constructor Summary
DefaultServerSessionPool()
           
DefaultServerSessionPool(SessionFactory sessionFactory, javax.jms.MessageListener listener, int numberOfServerSessions)
           
 
Method Summary
protected  javax.jms.ServerSession createServerSession()
           
 javax.jms.ServerSession getServerSession()
          Return a server session from the pool.
 void putServerSession(javax.jms.ServerSession serverSession)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

list

private java.util.LinkedList list
the list of ServerSession objects


sessionFactory

private SessionFactory sessionFactory
the factory used to create new Sessions


listener

private javax.jms.MessageListener listener
The MessageListener which are fired by new JMS Sessions


timeout

private long timeout
maximum blocking time, just in case a notify goes walkies

Constructor Detail

DefaultServerSessionPool

public DefaultServerSessionPool()

DefaultServerSessionPool

public DefaultServerSessionPool(SessionFactory sessionFactory,
                                javax.jms.MessageListener listener,
                                int numberOfServerSessions)
                         throws javax.jms.JMSException
Throws:
javax.jms.JMSException
Method Detail

getServerSession

public javax.jms.ServerSession getServerSession()
                                         throws javax.jms.JMSException
Return a server session from the pool.

Specified by:
getServerSession in interface javax.jms.ServerSessionPool
Returns:
a server session from the pool.
Throws:
javax.jms.JMSException - if a JMS error occurs.

putServerSession

public void putServerSession(javax.jms.ServerSession serverSession)

createServerSession

protected javax.jms.ServerSession createServerSession()
                                               throws javax.jms.JMSException
Throws:
javax.jms.JMSException