|
|||||||||
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.jdbc.PoolingDataSource
public class PoolingDataSource
Implementation of a JDBC DataSource
wrapping vendor's XADataSource
implementation.
Constructor Summary | |
---|---|
PoolingDataSource()
|
Method Summary | |
---|---|
void |
close()
Release this XAResourceProducer 's internal resources. |
java.sql.Array |
createArrayOf(java.lang.String typeName,
java.lang.Object[] elements)
|
java.sql.Blob |
createBlob()
|
java.sql.Clob |
createClob()
|
java.sql.NClob |
createNClob()
|
XAStatefulHolder |
createPooledConnection(java.lang.Object xaFactory,
ResourceBean bean)
Create a XAStatefulHolder that will be placed in an XAPool . |
java.sql.SQLXML |
createSQLXML()
|
java.sql.Struct |
createStruct(java.lang.String typeName,
java.lang.Object[] attributes)
|
void |
endRecovery()
Release internal resources held after call to startRecovery() . |
XAResourceHolder |
findXAResourceHolder(javax.transaction.xa.XAResource xaResource)
Find in the XAResourceHolder s created by this XAResourceProducer the one which this
XAResource belongs to. |
java.util.Properties |
getClientInfo()
|
java.lang.String |
getClientInfo(java.lang.String name)
|
java.sql.Connection |
getConnection()
|
java.sql.Connection |
getConnection(java.lang.String username,
java.lang.String password)
|
java.lang.String |
getIsolationLevel()
|
int |
getLoginTimeout()
|
java.io.PrintWriter |
getLogWriter()
|
int |
getPreparedStatementCacheSize()
|
javax.naming.Reference |
getReference()
PoolingDataSource must alway have a unique name so this method builds a reference to this object using
the unique name as RefAddr . |
java.lang.String |
getTestQuery()
|
void |
init()
Initializes the pool by creating the initial amount of connections. |
boolean |
isValid(int timeout)
|
boolean |
isWrapperFor(java.lang.Class iface)
|
void |
setClientInfo(java.util.Properties properties)
|
void |
setClientInfo(java.lang.String name,
java.lang.String value)
|
void |
setFailed(boolean failed)
Mark this resource producer as failed or not. |
void |
setIsolationLevel(java.lang.String isolationLevel)
|
void |
setLoginTimeout(int seconds)
|
void |
setLogWriter(java.io.PrintWriter out)
|
void |
setPreparedStatementCacheSize(int preparedStatementCacheSize)
|
void |
setTestQuery(java.lang.String testQuery)
When set, the specified query will be executed on the connection acquired from the pool before being handed to the caller. |
XAResourceHolderState |
startRecovery()
Prepare the recoverable XAResource producer for recovery. |
java.lang.String |
toString()
|
java.lang.Object |
unwrap(java.lang.Class iface)
|
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 |
Constructor Detail |
---|
public PoolingDataSource()
Method Detail |
---|
public void init()
init
in interface XAResourceProducer
public java.lang.String getTestQuery()
public void setTestQuery(java.lang.String testQuery)
testQuery
- the query that will be used to test connections.public int getPreparedStatementCacheSize()
public void setPreparedStatementCacheSize(int preparedStatementCacheSize)
public java.lang.String getIsolationLevel()
public void setIsolationLevel(java.lang.String isolationLevel)
public java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
java.sql.SQLException
public java.sql.Connection getConnection(java.lang.String username, java.lang.String password) throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
java.sql.SQLException
public java.lang.String toString()
toString
in class java.lang.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 void close()
XAResourceProducer
XAResourceProducer
's internal resources.
close
in interface XAResourceProducer
public XAStatefulHolder createPooledConnection(java.lang.Object xaFactory, ResourceBean bean) throws java.lang.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
.
java.lang.Exception
- thrown when the XAStatefulHolder
cannot be created.public XAResourceHolder findXAResourceHolder(javax.transaction.xa.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 javax.naming.Reference getReference() throws javax.naming.NamingException
PoolingDataSource
must alway have a unique name so this method builds a reference to this object using
the unique name as RefAddr
.
getReference
in interface javax.naming.Referenceable
PoolingDataSource
.
javax.naming.NamingException
public int getLoginTimeout() throws java.sql.SQLException
getLoginTimeout
in interface javax.sql.CommonDataSource
java.sql.SQLException
public void setLoginTimeout(int seconds) throws java.sql.SQLException
setLoginTimeout
in interface javax.sql.CommonDataSource
java.sql.SQLException
public java.io.PrintWriter getLogWriter() throws java.sql.SQLException
getLogWriter
in interface javax.sql.CommonDataSource
java.sql.SQLException
public void setLogWriter(java.io.PrintWriter out) throws java.sql.SQLException
setLogWriter
in interface javax.sql.CommonDataSource
java.sql.SQLException
public java.sql.Clob createClob() throws java.sql.SQLException
java.sql.SQLException
public java.sql.Blob createBlob() throws java.sql.SQLException
java.sql.SQLException
public java.sql.NClob createNClob() throws java.sql.SQLException
java.sql.SQLException
public java.sql.SQLXML createSQLXML() throws java.sql.SQLException
java.sql.SQLException
public boolean isValid(int timeout) throws java.sql.SQLException
java.sql.SQLException
public void setClientInfo(java.lang.String name, java.lang.String value) throws java.sql.SQLClientInfoException
java.sql.SQLClientInfoException
public void setClientInfo(java.util.Properties properties) throws java.sql.SQLClientInfoException
java.sql.SQLClientInfoException
public java.lang.String getClientInfo(java.lang.String name) throws java.sql.SQLException
java.sql.SQLException
public java.util.Properties getClientInfo() throws java.sql.SQLException
java.sql.SQLException
public java.sql.Array createArrayOf(java.lang.String typeName, java.lang.Object[] elements) throws java.sql.SQLException
java.sql.SQLException
public java.sql.Struct createStruct(java.lang.String typeName, java.lang.Object[] attributes) throws java.sql.SQLException
java.sql.SQLException
public boolean isWrapperFor(java.lang.Class iface) throws java.sql.SQLException
isWrapperFor
in interface java.sql.Wrapper
java.sql.SQLException
public java.lang.Object unwrap(java.lang.Class iface) throws java.sql.SQLException
unwrap
in interface java.sql.Wrapper
java.sql.SQLException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |