|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbitronix.tm.resource.common.ResourceBean
bitronix.tm.resource.jms.PoolingConnectionFactory
public class PoolingConnectionFactory
Implementation of a JMS ConnectionFactory
wrapping vendor's XAConnectionFactory
implementation.
Constructor Summary | |
---|---|
PoolingConnectionFactory()
|
Method Summary | |
---|---|
void |
close()
Release this XAResourceProducer 's internal resources. |
javax.jms.Connection |
createConnection()
|
javax.jms.Connection |
createConnection(String userName,
String password)
|
XAStatefulHolder |
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() . |
XAResourceHolder |
findXAResourceHolder(XAResource xaResource)
Find in the XAResourceHolder s 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()
|
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)
|
XAResourceHolderState |
startRecovery()
Prepare the recoverable XAResource producer for recovery. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface bitronix.tm.resource.common.XAResourceProducer |
---|
getUniqueName |
Methods inherited from interface bitronix.tm.resource.jms.PoolingConnectionFactoryMBean |
---|
getMaxPoolSize, getMinPoolSize, isDisabled, setDisabled |
Constructor Detail |
---|
public PoolingConnectionFactory()
Method Detail |
---|
public void init()
init
in interface XAResourceProducer
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.Connection createConnection() throws javax.jms.JMSException
createConnection
in interface javax.jms.ConnectionFactory
javax.jms.JMSException
public javax.jms.Connection createConnection(String userName, String password) throws javax.jms.JMSException
createConnection
in interface javax.jms.ConnectionFactory
javax.jms.JMSException
public String toString()
toString
in class Object
public XAResourceHolderState startRecovery() throws RecoveryException
XAResourceProducer
XAResource
producer for recovery.
startRecovery
in interface XAResourceProducer
XAResourceHolderState
object that can be used to call recover()
.
RecoveryException
- thrown when a XAResourceHolderState
cannot be acquired.public void endRecovery() throws RecoveryException
XAResourceProducer
startRecovery()
.
endRecovery
in interface XAResourceProducer
RecoveryException
- thrown when an error occured while releasing reserved resources.public void setFailed(boolean failed)
XAResourceProducer
setFailed
in interface XAResourceProducer
failed
- true is the resource must be considered failed, false it it must be considered sane.public boolean isFailed()
isFailed
in interface PoolingConnectionFactoryMBean
public void close()
XAResourceProducer
XAResourceProducer
's internal resources.
close
in interface XAResourceProducer
public XAStatefulHolder createPooledConnection(Object xaFactory, ResourceBean bean) throws Exception
XAResourceProducer
XAStatefulHolder
that will be placed in an XAPool
.
createPooledConnection
in interface XAResourceProducer
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 XAResourceHolder findXAResourceHolder(XAResource xaResource)
XAResourceProducer
XAResourceHolder
s created by this XAResourceProducer
the one which this
XAResource
belongs to.
findXAResourceHolder
in interface XAResourceProducer
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 Referenceable
PoolingConnectionFactory
.
NamingException
public long getInPoolSize()
getInPoolSize
in interface PoolingConnectionFactoryMBean
public long getTotalPoolSize()
getTotalPoolSize
in interface PoolingConnectionFactoryMBean
public void reset() throws Exception
reset
in interface PoolingConnectionFactoryMBean
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |