|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jboss.minerva.pools.PoolObjectFactory | +--org.jboss.minerva.factories.XAConnectionFactory
Object factory for JDBC 2.0 standard extension XAConnections. You pool the XAConnections instead of the java.sql.Connections since with vendor conformant drivers, you don't have direct access to the java.sql.Connection, and any work done isn't associated with the java.sql.Connection anyway.
Note: This implementation requires that the TransactionManager be bound to a JNDI name.
Note: This implementation has special handling for Minerva JDBC 1/2 XA Wrappers. Namely, when a request comes in, if it is for a wrapper connection and it has the same current transaction as a previous active connection, the same previous connection will be returned. Otherwise, you won't be able to share changes across connections like you can with the native JDBC 2 Standard Extension implementations.
Constructor Summary | |
XAConnectionFactory()
Creates a new factory. |
Method Summary | |
java.lang.Object |
createObject()
Creates a new XAConnection from the provided XADataSource. |
void |
deleteObject(java.lang.Object pooledObject)
Closes a connection. |
javax.sql.XADataSource |
getDataSource()
Gets the XADataSource used to generate XAConnections. |
java.lang.String |
getPassword()
Gets the password used to generate XAConnections. |
java.lang.String |
getTransactionManagerJNDIName()
Gets the JNDI name that the TransactionManager is registered under. |
java.lang.String |
getUser()
Gets the user name used to generate XAConnections. |
java.lang.Object |
isUniqueRequest()
If a new object is requested and it is a JDBC 1/2 wrapper connection in the same Transaction as an existing connection, return that same connection. |
void |
poolStarted(ObjectPool pool,
java.io.PrintWriter log)
Verifies that the data source and transaction manager are accessible. |
java.lang.Object |
prepareObject(java.lang.Object pooledObject)
Registers the XAConnection's XAResource with the current transaction (if there is one). |
void |
setDataSource(javax.sql.XADataSource dataSource)
Sets the XADataSource used to generate XAConnections. |
void |
setPassword(java.lang.String password)
Sets the password used to generate XAConnections. |
void |
setTransactionManagerJNDIName(java.lang.String name)
Sets the JNDI name that the TransactionManager is registered under. |
void |
setUser(java.lang.String userName)
Sets the user name used to generate XAConnections. |
Methods inherited from class org.jboss.minerva.pools.PoolObjectFactory |
poolClosing, returnObject, translateObject |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XAConnectionFactory() throws javax.naming.NamingException
Method Detail |
public void setUser(java.lang.String userName)
public java.lang.String getUser()
public void setPassword(java.lang.String password)
public java.lang.String getPassword()
public void setDataSource(javax.sql.XADataSource dataSource)
XADataSourceImpl
public javax.sql.XADataSource getDataSource()
public void setTransactionManagerJNDIName(java.lang.String name)
public java.lang.String getTransactionManagerJNDIName()
public void poolStarted(ObjectPool pool, java.io.PrintWriter log)
poolStarted
in class PoolObjectFactory
org.jboss.minerva.pools.PoolObjectFactory
pool
- The pool that is starting. You may decide to allow
multiple pools you use your factory, or to restrict it to a one-to-one
relationship.log
- A writer you can use to log messages. Use this in preference
to System.xxx.println.java.lang.IllegalArgumentException
- Occurs when the pool is null.public java.lang.Object createObject()
createObject
in class PoolObjectFactory
org.jboss.minerva.pools.PoolObjectFactory
PoolObjectFactory.prepareObject(java.lang.Object)
public java.lang.Object prepareObject(java.lang.Object pooledObject)
prepareObject
in class PoolObjectFactory
org.jboss.minerva.pools.PoolObjectFactory
pooledObject
- The object in the pool, as created by createObject.public void deleteObject(java.lang.Object pooledObject)
deleteObject
in class PoolObjectFactory
public java.lang.Object isUniqueRequest()
isUniqueRequest
in class PoolObjectFactory
org.jboss.minerva.pools.PoolObjectFactory
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |