org.exolab.jmscts.jms.asf
Class BasicServerSessionPool

java.lang.Object
  |
  +--org.exolab.jmscts.jms.asf.BasicServerSessionPool
All Implemented Interfaces:
javax.jms.ServerSessionPool

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

Implementation of the javax.jms.ServerSessionPool interface.

Version:
$Revision: 1.2 $ $Date: 2004/02/02 03:49:55 $
Author:
Tim Anderson

Constructor Summary
BasicServerSessionPool(int size, javax.jms.Connection connection, boolean transacted, int ackMode, javax.jms.MessageListener listener)
          Construct a new BasicServerSessionPool
 
Method Summary
 void close()
          Close the pool, destroying any allocated sessions
protected  javax.jms.ServerSession create()
          Create a new server session
 javax.jms.ServerSession getServerSession()
          Return a server session from the pool
protected  void release(BasicServerSession session)
          Release a server session back to the pool
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicServerSessionPool

public BasicServerSessionPool(int size,
                              javax.jms.Connection connection,
                              boolean transacted,
                              int ackMode,
                              javax.jms.MessageListener listener)
                       throws javax.jms.JMSException
Construct a new BasicServerSessionPool
Parameters:
size - the maximum no. of sessions to allocate
connection - the connection to allocate sessions from
transacted - if true, allocate transacted sessions
ackMode - the message acknowledgement mode, for non-transacted sessions
listener - the listener to delegate messages to
Throws:
javax.jms.JMSException - if sessions cannot be allocated
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 an application server fails to return a server session from its pool

close

public void close()
           throws javax.jms.JMSException
Close the pool, destroying any allocated sessions
Throws:
javax.jms.JMSException - if the underlying session's can't be closed

release

protected void release(BasicServerSession session)
Release a server session back to the pool
Parameters:
session - the session to release

create

protected javax.jms.ServerSession create()
                                  throws javax.jms.JMSException
Create a new server session
Returns:
the new server session
Throws:
javax.jms.JMSException - if the session cannot be created


Copyright © 2001-2004 JMS CTS Team. All Rights Reserved.