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 Connection
createConnection(ConnectionKey key)
protected ConnectionPool
createConnectionPool(Connection connection)
Delegate that creates each instance of an ConnectionPool object.Object
getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment)
String
getTmJndiName()
TransactionManager
getTransactionManager()
Boolean
isTmFromJndi()
void
setConnectionFactory(Object toUse)
Sets the ConnectionFactory used to create new pooled Connections.void
setTmFromJndi(Boolean tmFromJndi)
Allow transaction manager resolution from JNDI (ee deployment)void
setTmJndiName(String tmJndiName)
void
setTransactionManager(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:PooledConnectionFactory
Sets 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:
setConnectionFactory
in classPooledConnectionFactory
- Parameters:
toUse
- The factory to use to create pooled Connections.
-
createConnection
protected Connection createConnection(ConnectionKey key) throws JMSException
- Overrides:
createConnection
in classPooledConnectionFactory
- Throws:
JMSException
-
createConnectionPool
protected ConnectionPool createConnectionPool(Connection connection)
Description copied from class:PooledConnectionFactory
Delegate that creates each instance of an ConnectionPool object. Subclasses can override this method to customize the type of connection pool returned.- Overrides:
createConnectionPool
in classPooledConnectionFactory
- Returns:
- instance of a new ConnectionPool.
-
getObjectInstance
public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment) throws Exception
- Specified by:
getObjectInstance
in 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
-
-
-