public class PoolingConnectionFactory extends ResourceBean implements javax.jms.ConnectionFactory, XAResourceProducer<DualSessionWrapper,JmsPooledConnection>, PoolingConnectionFactoryMBean
ConnectionFactory wrapping vendor's XAConnectionFactory implementation.| Constructor and Description |
|---|
PoolingConnectionFactory() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Release this
XAResourceProducer's internal resources. |
javax.jms.Connection |
createConnection() |
javax.jms.Connection |
createConnection(String userName,
String password) |
JmsPooledConnection |
createPooledConnection(Object xaFactory,
ResourceBean bean)
Create a
XAStatefulHolder that will be placed in an XAPool. |
void |
endRecovery()
Release internal resources held after call to
startRecovery(). |
DualSessionWrapper |
findXAResourceHolder(XAResource xaResource)
Find in the
XAResourceHolders created by this XAResourceProducer the one which this
XAResource belongs to. |
boolean |
getCacheProducersConsumers() |
long |
getInPoolSize() |
String |
getPassword() |
Reference |
getReference()
PoolingConnectionFactory must alway have a unique name so this method builds a reference to this object
using the unique name as RefAddr. |
boolean |
getTestConnections() |
long |
getTotalPoolSize() |
String |
getUser() |
javax.jms.XAConnectionFactory |
getXaConnectionFactory() |
void |
init()
Initialize the pool by creating the initial amount of connections.
|
boolean |
isFailed() |
void |
reset() |
void |
setCacheProducersConsumers(boolean cacheProducersConsumers) |
void |
setFailed(boolean failed)
Mark this resource producer as failed or not.
|
void |
setPassword(String password) |
void |
setTestConnections(boolean testConnections) |
void |
setUser(String user) |
void |
setXaConnectionFactory(javax.jms.XAConnectionFactory xaConnectionFactory)
Inject a pre-configured XAConnectionFactory instead of relying on className and driverProperties
to build one.
|
XAResourceHolderState |
startRecovery()
Prepare the recoverable
XAResource producer for recovery. |
String |
toString() |
getAcquireIncrement, getAcquisitionInterval, getAcquisitionTimeout, getAllowLocalTransactions, getApplyTransactionTimeout, getAutomaticEnlistingEnabled, getClassName, getDeferConnectionRelease, getDriverProperties, getIgnoreRecoveryFailures, getMaxIdleTime, getMaxLifeTime, getMaxPoolSize, getMinPoolSize, getShareTransactionConnections, getTwoPcOrderingPosition, getUniqueName, getUseTmJoin, incCreatedResourcesCounter, isDisabled, setAcquireIncrement, setAcquisitionInterval, setAcquisitionTimeout, setAllowLocalTransactions, setApplyTransactionTimeout, setAutomaticEnlistingEnabled, setClassName, setDeferConnectionRelease, setDisabled, setDriverProperties, setIgnoreRecoveryFailures, setMaxIdleTime, setMaxLifeTime, setMaxPoolSize, setMinPoolSize, setShareTransactionConnections, setTwoPcOrderingPosition, setUniqueName, setUseTmJoinclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetUniqueNamegetMaxPoolSize, getMinPoolSize, isDisabled, setDisabledpublic void init()
init in interface XAResourceProducer<DualSessionWrapper,JmsPooledConnection>public boolean getCacheProducersConsumers()
public void setCacheProducersConsumers(boolean cacheProducersConsumers)
public boolean getTestConnections()
public void setTestConnections(boolean testConnections)
public String getUser()
public void setUser(String user)
public String getPassword()
public void setPassword(String password)
public javax.jms.XAConnectionFactory getXaConnectionFactory()
public void setXaConnectionFactory(javax.jms.XAConnectionFactory xaConnectionFactory)
xaConnectionFactory - the pre-configured XAConnectionFactory.public javax.jms.Connection createConnection()
throws javax.jms.JMSException
createConnection in interface javax.jms.ConnectionFactoryjavax.jms.JMSExceptionpublic javax.jms.Connection createConnection(String userName, String password) throws javax.jms.JMSException
createConnection in interface javax.jms.ConnectionFactoryjavax.jms.JMSExceptionpublic XAResourceHolderState startRecovery() throws RecoveryException
XAResourceProducerXAResource producer for recovery.startRecovery in interface XAResourceProducer<DualSessionWrapper,JmsPooledConnection>XAResourceHolderState object that can be used to call recover().RecoveryException - thrown when a XAResourceHolderState cannot be acquired.public void endRecovery()
throws RecoveryException
XAResourceProducerstartRecovery().endRecovery in interface XAResourceProducer<DualSessionWrapper,JmsPooledConnection>RecoveryException - thrown when an error occurred while releasing reserved resources.public void setFailed(boolean failed)
XAResourceProducersetFailed in interface XAResourceProducer<DualSessionWrapper,JmsPooledConnection>failed - true is the resource must be considered failed, false it it must be considered sane.public boolean isFailed()
isFailed in interface PoolingConnectionFactoryMBeanpublic void close()
XAResourceProducerXAResourceProducer's internal resources.close in interface XAResourceProducer<DualSessionWrapper,JmsPooledConnection>public JmsPooledConnection createPooledConnection(Object xaFactory, ResourceBean bean) throws Exception
XAResourceProducerXAStatefulHolder that will be placed in an XAPool.createPooledConnection in interface XAResourceProducer<DualSessionWrapper,JmsPooledConnection>xaFactory - the vendor's resource-specific XA factory.bean - the resource-specific bean describing the resource parameters.XAStatefulHolder that will be placed in an XAPool.Exception - thrown when the XAStatefulHolder cannot be created.public DualSessionWrapper findXAResourceHolder(XAResource xaResource)
XAResourceProducerXAResourceHolders created by this XAResourceProducer the one which this
XAResource belongs to.findXAResourceHolder in interface XAResourceProducer<DualSessionWrapper,JmsPooledConnection>xaResource - the XAResource to look for.XAResourceHolder or null if the XAResource does not belong to this
XAResourceProducer.public Reference getReference() throws NamingException
PoolingConnectionFactory must alway have a unique name so this method builds a reference to this object
using the unique name as RefAddr.getReference in interface ReferenceablePoolingConnectionFactory.NamingExceptionpublic long getInPoolSize()
getInPoolSize in interface PoolingConnectionFactoryMBeanpublic long getTotalPoolSize()
getTotalPoolSize in interface PoolingConnectionFactoryMBeanpublic void reset()
throws Exception
reset in interface PoolingConnectionFactoryMBeanExceptionCopyright © 2006-2016 Bitronix Software. All Rights Reserved.