|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atomikos.jdbc.XAConnectionFactory
public class XAConnectionFactory
A default connection factory for XA connections that work with the Atomikos connection pools.
Constructor Summary | |
---|---|
|
XAConnectionFactory(String resourceName,
String userName,
String passwd,
XADataSource xaDataSource)
Creates a new instance with a given resource name, user name and password for the XADataSource. |
protected |
XAConnectionFactory(String resourceName,
String userName,
String passwd,
XADataSource xaDataSource,
JdbcTransactionalResource res)
Constructor for subclasses with their own transactional resource. |
|
XAConnectionFactory(String resourceName,
String userName,
String passwd,
XADataSource xaDataSource,
XidFactory xidFactory)
Creates a new instance with a given resource name, user name and password for the XADataSource, and a custom XidFactory. |
Method Summary | |
---|---|
int |
getLoginTimeout()
Get the login timeout in seconds |
PrintWriter |
getLogWriter()
Gets the log writer for debugging. |
protected String |
getPassword()
Used by getPooledConnection() to get a connection. |
XPooledConnection |
getPooledConnection()
The main method: gets a new DTPPooledConnection instance. |
TransactionalResource |
getTransactionalResource()
Get the transactional resource. |
protected String |
getUserName()
Used by getPooledConnection() to get a connection. |
XADataSource |
getXADataSource()
This method gets the underlying data source. |
boolean |
isExclusive()
Tests if the connections that are generated will be exclusive or not. |
void |
setExclusive(boolean exclusive)
Sets the connections generated to exclusive for 2PC. |
void |
setLoginTimeout(int secs)
Sets the login timeout. |
void |
setLogWriter(PrintWriter pw)
Sets the log writer for debugging. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected XAConnectionFactory(String resourceName, String userName, String passwd, XADataSource xaDataSource, JdbcTransactionalResource res)
public XAConnectionFactory(String resourceName, String userName, String passwd, XADataSource xaDataSource)
resourceName
- The unique resource name for the corresponding
JdbcTransactionalResource (which will be created
automatically).userName
- The user name to use for getting XA connections. Null if no
authentication is supported by the supplied XADataSource.passwd
- The password for the user, or null if no authentication is
supported by the supplied XADataSource.xaDataSource
- The XADataSource to use.public XAConnectionFactory(String resourceName, String userName, String passwd, XADataSource xaDataSource, XidFactory xidFactory)
resourceName
- The unique resource name for the corresponding
JdbcTransactionalResource (which will be created
automatically).userName
- The user name to use for getting XA connections. Null if no
authentication is supported by the supplied XADataSource.passwd
- The password for the user, or null if no authentication is
supported by the supplied XADataSource.xaDataSource
- The XADataSource to use.xidFactory
- The custom XidFactory.Method Detail |
---|
protected String getUserName()
protected String getPassword()
public XADataSource getXADataSource()
public void setExclusive(boolean exclusive)
exclusive
- If true, then connections will be kept until after
commit/rollback, resulting in lower reuse.public boolean isExclusive()
public TransactionalResource getTransactionalResource()
public XPooledConnection getPooledConnection() throws IllegalStateException, SQLException
getPooledConnection
in interface ConnectionFactory
IllegalStateException
- If not initialized.
SQLException
- On sql errors.public PrintWriter getLogWriter() throws SQLException
ConnectionFactory
getLogWriter
in interface ConnectionFactory
SQLException
- On error.public void setLogWriter(PrintWriter pw) throws SQLException
ConnectionFactory
setLogWriter
in interface ConnectionFactory
pw
- The print writer to log to.
SQLException
- On error.public int getLoginTimeout() throws SQLException
ConnectionFactory
getLoginTimeout
in interface ConnectionFactory
SQLException
- On error.public void setLoginTimeout(int secs) throws SQLException
ConnectionFactory
setLoginTimeout
in interface ConnectionFactory
secs
- The no of seconds.
SQLException
- On error.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |