org.activemq.pool
Class SessionPool

java.lang.Object
  extended byorg.activemq.pool.SessionPool
All Implemented Interfaces:
org.apache.commons.pool.PoolableObjectFactory

public class SessionPool
extends Object
implements org.apache.commons.pool.PoolableObjectFactory

Represents the session pool for a given JMS connection.

Version:
$Revision: 1.1 $

Constructor Summary
SessionPool(ActiveMQConnection connection, SessionKey key)
           
SessionPool(ActiveMQConnection connection, SessionKey key, org.apache.commons.pool.ObjectPool sessionPool)
           
 
Method Summary
 void activateObject(Object o)
           
 PooledSession borrowSession()
           
protected  ActiveMQSession createSession()
           
 void destroyObject(Object o)
           
protected  ActiveMQConnection getConnection()
           
 Object makeObject()
           
 void passivateObject(Object o)
           
 boolean validateObject(Object o)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionPool

public SessionPool(ActiveMQConnection connection,
                   SessionKey key)

SessionPool

public SessionPool(ActiveMQConnection connection,
                   SessionKey key,
                   org.apache.commons.pool.ObjectPool sessionPool)
Method Detail

borrowSession

public PooledSession borrowSession()
                            throws JMSException
Throws:
JMSException

makeObject

public Object makeObject()
                  throws Exception
Specified by:
makeObject in interface org.apache.commons.pool.PoolableObjectFactory
Throws:
Exception

destroyObject

public void destroyObject(Object o)
                   throws Exception
Specified by:
destroyObject in interface org.apache.commons.pool.PoolableObjectFactory
Throws:
Exception

validateObject

public boolean validateObject(Object o)
Specified by:
validateObject in interface org.apache.commons.pool.PoolableObjectFactory

activateObject

public void activateObject(Object o)
                    throws Exception
Specified by:
activateObject in interface org.apache.commons.pool.PoolableObjectFactory
Throws:
Exception

passivateObject

public void passivateObject(Object o)
                     throws Exception
Specified by:
passivateObject in interface org.apache.commons.pool.PoolableObjectFactory
Throws:
Exception

getConnection

protected ActiveMQConnection getConnection()
                                    throws JMSException
Throws:
JMSException

createSession

protected ActiveMQSession createSession()
                                 throws JMSException
Throws:
JMSException


Copyright © 2004-2007 Protique, Ltd.. All Rights Reserved.