|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.atomikos.jdbc.JtaDataSourceImp
public class JtaDataSourceImp
Copyright © 2001-2007, Atomikos. All rights reserved. A basic datasource implementation that works with Atomikos connection pools and supports heuristic messages. Instances are referenceable in JNDI, but not Serializable.
Note: instead of using this class directly, it is highly recommended that you use one of the Serializable Atomikos DataSourceBean implementations instead.
| Constructor Summary | |
|---|---|
JtaDataSourceImp(XAConnectionFactory fact,
int poolSize,
int connectionTimeout,
String testQuery,
boolean testOnBorrow)
Creates a new instance. |
|
| Method Summary | |
|---|---|
void |
close()
Cleans up the instance, and closes the pool. |
void |
connectionClosed(ConnectionEvent arg)
|
void |
connectionErrorOccurred(ConnectionEvent arg)
|
Connection |
getConnection()
|
Connection |
getConnection(HeuristicMessage msg)
Get a connection to the datasource for the given description of the work. |
Connection |
getConnection(String msg)
Get a connection to the datasource for the given description of the work. |
Connection |
getConnection(String username,
String passwd)
Not implemented in this release; throws SQLException. |
Connection |
getConnection(String user,
String passwd,
HeuristicMessage msg)
Not implemented in this release; throws SQLException. |
Connection |
getConnection(String user,
String passwd,
String msg)
Get a connection to the datasource for the given description of the work. |
int |
getLoginTimeout()
|
PrintWriter |
getLogWriter()
|
PooledConnection |
getPooledConnection()
|
PooledConnection |
getPooledConnection(String user,
String pw)
|
Reference |
getReference()
|
TransactionalResource |
getTransactionalResource()
Get the underlying transactional resource. |
void |
setLoginTimeout(int seconds)
|
void |
setLogWriter(PrintWriter pw)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JtaDataSourceImp(XAConnectionFactory fact,
int poolSize,
int connectionTimeout,
String testQuery,
boolean testOnBorrow)
throws SQLException
fact - The XAConnectionFactory to use.poolSize - The size of the pool.connectionTimeout - The timeout in seconds for each connection.testQuery - A test query to validate connection liveness.testOnBorrow - If true then connections will be tested when gotten from the pool.
SQLException - On error.| Method Detail |
|---|
public Connection getConnection()
throws SQLException
getConnection in interface DataSourceSQLExceptionDataSource
public Connection getConnection(String username,
String passwd)
throws SQLException
getConnection in interface DataSourceSQLException
public Connection getConnection(String user,
String passwd,
HeuristicMessage msg)
throws SQLException
getConnection in interface HeuristicDataSourceuser - The user name to use.passwd - The password.msg - The heuristic message that best describes the work about to be
done.
SQLException - On error.
public PrintWriter getLogWriter()
throws SQLException
getLogWriter in interface ConnectionPoolDataSourcegetLogWriter in interface DataSourceSQLExceptionDataSource
public void setLogWriter(PrintWriter pw)
throws SQLException
setLogWriter in interface ConnectionPoolDataSourcesetLogWriter in interface DataSourceSQLExceptionDataSource
public void setLoginTimeout(int seconds)
throws SQLException
setLoginTimeout in interface ConnectionPoolDataSourcesetLoginTimeout in interface DataSourceSQLExceptionDataSource
public int getLoginTimeout()
throws SQLException
getLoginTimeout in interface ConnectionPoolDataSourcegetLoginTimeout in interface DataSourceSQLExceptionDataSourcepublic void close()
public TransactionalResource getTransactionalResource()
public Reference getReference()
throws NamingException
getReference in interface ReferenceableNamingExceptionReferenceable
public Connection getConnection(HeuristicMessage msg)
throws SQLException
HeuristicDataSource
getConnection in interface HeuristicDataSourcemsg - The heuristic message that best describes the work about to be
done.
SQLException - On error.HeuristicDataSource.getConnection(com.atomikos.icatch.HeuristicMessage)public void connectionClosed(ConnectionEvent arg)
connectionClosed in interface ConnectionEventListenerConnectionEventListener.connectionClosed(javax.sql.ConnectionEvent)public void connectionErrorOccurred(ConnectionEvent arg)
connectionErrorOccurred in interface ConnectionEventListenerConnectionEventListener.connectionErrorOccurred(javax.sql.ConnectionEvent)
public PooledConnection getPooledConnection()
throws SQLException
getPooledConnection in interface ConnectionPoolDataSourceSQLExceptionConnectionPoolDataSource.getPooledConnection()
public PooledConnection getPooledConnection(String user,
String pw)
throws SQLException
getPooledConnection in interface ConnectionPoolDataSourceSQLExceptionConnectionPoolDataSource.getPooledConnection(java.lang.String,
java.lang.String)
public Connection getConnection(String msg)
throws SQLException
HeuristicDataSource
getConnection in interface HeuristicDataSourcemsg - The heuristic message that best describes the work about to be
done.
SQLException - On error.HeuristicDataSource.getConnection(java.lang.String)
public Connection getConnection(String user,
String passwd,
String msg)
throws SQLException
HeuristicDataSource
getConnection in interface HeuristicDataSourceuser - The user name to use.passwd - The password.msg - The heuristic message that best describes the work about to be
done.
SQLException - On error.HeuristicDataSource.getConnection(java.lang.String,
java.lang.String, java.lang.String)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||