org.jencks.amqpool
Class SessionPool

java.lang.Object
  extended by org.jencks.amqpool.SessionPool
All Implemented Interfaces:
org.apache.commons.pool.PoolableObjectFactory

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

Represents the session pool for a given JMS connection.

Version:
$Revision: 171 $

Constructor Summary
SessionPool(ConnectionPool connectionPool, SessionKey key, org.apache.commons.pool.ObjectPool sessionPool)
           
 
Method Summary
 void activateObject(java.lang.Object o)
           
 PooledSession borrowSession()
           
 void close()
           
protected  org.apache.activemq.ActiveMQSession createSession()
           
 void destroyObject(java.lang.Object o)
           
protected  org.apache.activemq.ActiveMQConnection getConnection()
           
protected  org.apache.commons.pool.ObjectPool getSessionPool()
           
 java.lang.Object makeObject()
           
 void passivateObject(java.lang.Object o)
           
 void returnSession(PooledSession session)
           
 boolean validateObject(java.lang.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,
                   org.apache.commons.pool.ObjectPool sessionPool)
Method Detail

close

public void close()
           throws java.lang.Exception
Throws:
java.lang.Exception

borrowSession

public PooledSession borrowSession()
                            throws javax.jms.JMSException
Throws:
javax.jms.JMSException

returnSession

public void returnSession(PooledSession session)
                   throws javax.jms.JMSException
Throws:
javax.jms.JMSException

makeObject

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

destroyObject

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

validateObject

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

activateObject

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

passivateObject

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

getSessionPool

protected org.apache.commons.pool.ObjectPool getSessionPool()
                                                     throws org.apache.activemq.AlreadyClosedException
Throws:
org.apache.activemq.AlreadyClosedException

getConnection

protected org.apache.activemq.ActiveMQConnection getConnection()
                                                        throws javax.jms.JMSException
Throws:
javax.jms.JMSException

createSession

protected org.apache.activemq.ActiveMQSession createSession()
                                                     throws javax.jms.JMSException
Throws:
javax.jms.JMSException


Copyright © 2009 LogicBlaze, Inc.. All Rights Reserved.