org.apache.activemq.pool
Class SessionPool

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

public class SessionPool
extends Object
implements PoolableObjectFactory

Represents the session pool for a given JMS connection.

Version:
$Revision: 1.1 $

Constructor Summary
SessionPool(ConnectionPool connectionPool, SessionKey key, ObjectPool sessionPool)
           
 
Method Summary
 void activateObject(Object o)
           
 PooledSession borrowSession()
           
 void close()
           
protected  ActiveMQSession createSession()
           
 void destroyObject(Object o)
           
protected  ActiveMQConnection getConnection()
           
protected  ObjectPool getSessionPool()
           
 void invalidateSession(PooledSession session)
           
 Object makeObject()
           
 void passivateObject(Object o)
           
 void returnSession(PooledSession session)
           
 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(ConnectionPool connectionPool,
                   SessionKey key,
                   ObjectPool sessionPool)
Method Detail

close

public void close()
           throws Exception
Throws:
Exception

borrowSession

public PooledSession borrowSession()
                            throws JMSException
Throws:
JMSException

returnSession

public void returnSession(PooledSession session)
                   throws JMSException
Throws:
JMSException

invalidateSession

public void invalidateSession(PooledSession session)
                       throws JMSException
Throws:
JMSException

makeObject

public Object makeObject()
                  throws Exception
Specified by:
makeObject in interface PoolableObjectFactory
Throws:
Exception

destroyObject

public void destroyObject(Object o)
                   throws Exception
Specified by:
destroyObject in interface PoolableObjectFactory
Throws:
Exception

validateObject

public boolean validateObject(Object o)
Specified by:
validateObject in interface PoolableObjectFactory

activateObject

public void activateObject(Object o)
                    throws Exception
Specified by:
activateObject in interface PoolableObjectFactory
Throws:
Exception

passivateObject

public void passivateObject(Object o)
                     throws Exception
Specified by:
passivateObject in interface PoolableObjectFactory
Throws:
Exception

getSessionPool

protected ObjectPool getSessionPool()
                             throws AlreadyClosedException
Throws:
AlreadyClosedException

getConnection

protected ActiveMQConnection getConnection()
                                    throws JMSException
Throws:
JMSException

createSession

protected ActiveMQSession createSession()
                                 throws JMSException
Throws:
JMSException


Copyright © 2005-2011 Apache Software Foundation. All Rights Reserved.