Package org.apache.activemq.jms.pool
Class XaPooledConnectionFactory
- java.lang.Object
-
- org.apache.activemq.jms.pool.PooledConnectionFactory
-
- org.apache.activemq.jms.pool.XaPooledConnectionFactory
-
- All Implemented Interfaces:
Serializable,ConnectionFactory,QueueConnectionFactory,TopicConnectionFactory,ObjectFactory
- Direct Known Subclasses:
JcaPooledConnectionFactory,XaPooledConnectionFactory
public class XaPooledConnectionFactory extends PooledConnectionFactory implements ObjectFactory, Serializable
A pooled connection factory that automatically enlists sessions in the current active XA transaction if any.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.activemq.jms.pool.PooledConnectionFactory
connectionFactory, stopped
-
-
Constructor Summary
Constructors Constructor Description XaPooledConnectionFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ConnectioncreateConnection(ConnectionKey key)protected ConnectionPoolcreateConnectionPool(Connection connection)Delegate that creates each instance of an ConnectionPool object.ObjectgetObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment)StringgetTmJndiName()TransactionManagergetTransactionManager()BooleanisTmFromJndi()voidsetConnectionFactory(Object toUse)Sets the ConnectionFactory used to create new pooled Connections.voidsetTmFromJndi(Boolean tmFromJndi)Allow transaction manager resolution from JNDI (ee deployment)voidsetTmJndiName(String tmJndiName)voidsetTransactionManager(TransactionManager transactionManager)-
Methods inherited from class org.apache.activemq.jms.pool.PooledConnectionFactory
clear, createConnection, createConnection, createQueueConnection, createQueueConnection, createTopicConnection, createTopicConnection, getBlockIfSessionPoolIsFullTimeout, getConnectionFactory, getConnectionsPool, getConnectionTimeout, getExpiryTimeout, getIdleTimeout, getMaxConnections, getMaximumActiveSessionPerConnection, getNumConnections, getTimeBetweenExpirationCheckMillis, initConnectionsPool, isBlockIfSessionPoolIsFull, isCreateConnectionOnStartup, isReconnectOnException, isUseAnonymousProducers, newPooledConnection, populateProperties, setBlockIfSessionPoolIsFull, setBlockIfSessionPoolIsFullTimeout, setConnectionTimeout, setCreateConnectionOnStartup, setExpiryTimeout, setIdleTimeout, setMaxConnections, setMaximumActiveSessionPerConnection, setReconnectOnException, setTimeBetweenExpirationCheckMillis, setUseAnonymousProducers, start, stop
-
-
-
-
Method Detail
-
getTransactionManager
public TransactionManager getTransactionManager()
-
setTransactionManager
public void setTransactionManager(TransactionManager transactionManager)
-
setConnectionFactory
public void setConnectionFactory(Object toUse)
Description copied from class:PooledConnectionFactorySets the ConnectionFactory used to create new pooled Connections. Updates to this value do not affect Connections that were previously created and placed into the pool. In order to allocate new Connections based off this new ConnectionFactory it is first necessary toPooledConnectionFactory.clear()the pooled Connections.- Overrides:
setConnectionFactoryin classPooledConnectionFactory- Parameters:
toUse- The factory to use to create pooled Connections.
-
createConnection
protected Connection createConnection(ConnectionKey key) throws JMSException
- Overrides:
createConnectionin classPooledConnectionFactory- Throws:
JMSException
-
createConnectionPool
protected ConnectionPool createConnectionPool(Connection connection)
Description copied from class:PooledConnectionFactoryDelegate that creates each instance of an ConnectionPool object. Subclasses can override this method to customize the type of connection pool returned.- Overrides:
createConnectionPoolin classPooledConnectionFactory- Returns:
- instance of a new ConnectionPool.
-
getObjectInstance
public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment) throws Exception
- Specified by:
getObjectInstancein interfaceObjectFactory- Throws:
Exception
-
getTmJndiName
public String getTmJndiName()
-
setTmJndiName
public void setTmJndiName(String tmJndiName)
-
isTmFromJndi
public Boolean isTmFromJndi()
-
setTmFromJndi
public void setTmFromJndi(Boolean tmFromJndi)
Allow transaction manager resolution from JNDI (ee deployment)- Parameters:
tmFromJndi-
-
-