public abstract class BaseWrapperManagedConnection
extends java.lang.Object
implements javax.resource.spi.ManagedConnection, org.jboss.jca.core.spi.transaction.ConnectableResource
Modifier and Type | Field and Description |
---|---|
protected java.sql.Connection |
con
The connection
|
protected boolean |
destroyed
Destroyed
|
protected static boolean |
ignoreInManagedAutoCommitCalls
Ignore in managed auto commit calls
|
protected java.util.concurrent.atomic.AtomicBoolean |
inLocalTransaction
Is inside a local transaction
|
protected boolean |
inManagedTransaction
Is inside a managed transaction
|
protected boolean |
jdbcAutoCommit
JDBC auto-commit
|
protected boolean |
jdbcReadOnly
JDBC read-only
|
protected int |
jdbcTransactionIsolation
JDBC transaction isolation
|
protected BaseWrapperManagedConnectionFactory |
mcf
The managed connection factory
|
protected javax.resource.spi.ManagedConnectionMetaData |
metadata
Metadata
|
protected java.util.Properties |
props
The properties
|
protected java.lang.Object |
stateLock
The state lock
|
protected boolean |
underlyingAutoCommit
Underlying auto-commit
|
protected boolean |
underlyingReadOnly
Underlying read-only
|
Constructor and Description |
---|
BaseWrapperManagedConnection(BaseWrapperManagedConnectionFactory mcf,
java.sql.Connection con,
java.util.Properties props,
int transactionIsolation,
int psCacheSize)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addConnectionEventListener(javax.resource.spi.ConnectionEventListener cel)
Add a connection event listener
|
void |
associateConnection(java.lang.Object handle)
Associate a handle
|
protected void |
broadcastConnectionError(java.lang.Throwable e)
Broad cast a connection error
|
protected void |
checkException(java.sql.SQLException e)
Check exception
|
protected void |
checkState()
Check state
|
boolean |
checkValid()
Check valid
|
void |
cleanup() |
void |
destroy()
Destroy
|
java.lang.AutoCloseable |
getConnection() |
java.lang.Object |
getConnection(javax.security.auth.Subject subject,
javax.resource.spi.ConnectionRequestInfo cri)
Get a connection
|
protected org.jboss.logging.Logger |
getLog()
Get the logger
|
java.io.PrintWriter |
getLogWriter() |
javax.resource.spi.ManagedConnectionMetaData |
getMetaData() |
java.util.Properties |
getProperties()
Get the properties
|
abstract boolean |
isXA()
Returns true if the underlying connection is handled by an XA resource manager
|
protected void |
lock()
Lock
|
void |
removeConnectionEventListener(javax.resource.spi.ConnectionEventListener cel)
Remove a connection event listener
|
void |
setLogWriter(java.io.PrintWriter param1) |
protected void |
tryLock()
Try lock
|
protected void |
unlock()
Unlock
|
protected final BaseWrapperManagedConnectionFactory mcf
protected final java.sql.Connection con
protected java.util.Properties props
protected final java.lang.Object stateLock
protected boolean inManagedTransaction
protected java.util.concurrent.atomic.AtomicBoolean inLocalTransaction
protected boolean jdbcAutoCommit
protected static boolean ignoreInManagedAutoCommitCalls
protected boolean underlyingAutoCommit
protected boolean jdbcReadOnly
protected boolean underlyingReadOnly
protected int jdbcTransactionIsolation
protected boolean destroyed
protected javax.resource.spi.ManagedConnectionMetaData metadata
public BaseWrapperManagedConnection(BaseWrapperManagedConnectionFactory mcf, java.sql.Connection con, java.util.Properties props, int transactionIsolation, int psCacheSize) throws java.sql.SQLException
mcf
- The managed connection factorycon
- The connectionprops
- The propertiestransactionIsolation
- The transaction isolationpsCacheSize
- The prepared statement cache sizejava.sql.SQLException
- Thrown if an error occurspublic void addConnectionEventListener(javax.resource.spi.ConnectionEventListener cel)
addConnectionEventListener
in interface javax.resource.spi.ManagedConnection
cel
- The listenerpublic void removeConnectionEventListener(javax.resource.spi.ConnectionEventListener cel)
removeConnectionEventListener
in interface javax.resource.spi.ManagedConnection
cel
- The listenerpublic void associateConnection(java.lang.Object handle) throws javax.resource.ResourceException
associateConnection
in interface javax.resource.spi.ManagedConnection
handle
- The handlejavax.resource.ResourceException
- Thrown if an error occurspublic java.io.PrintWriter getLogWriter() throws javax.resource.ResourceException
getLogWriter
in interface javax.resource.spi.ManagedConnection
javax.resource.ResourceException
public javax.resource.spi.ManagedConnectionMetaData getMetaData() throws javax.resource.ResourceException
getMetaData
in interface javax.resource.spi.ManagedConnection
javax.resource.ResourceException
public void setLogWriter(java.io.PrintWriter param1) throws javax.resource.ResourceException
setLogWriter
in interface javax.resource.spi.ManagedConnection
javax.resource.ResourceException
public void cleanup() throws javax.resource.ResourceException
cleanup
in interface javax.resource.spi.ManagedConnection
javax.resource.ResourceException
protected void lock()
protected void tryLock() throws java.sql.SQLException
java.sql.SQLException
- Thrown if a lock can't be obtainedprotected void unlock()
public java.lang.Object getConnection(javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo cri) throws javax.resource.ResourceException
getConnection
in interface javax.resource.spi.ManagedConnection
subject
- The subjectcri
- The connection request infojavax.resource.ResourceException
- Thrown if an error occurspublic void destroy() throws javax.resource.ResourceException
destroy
in interface javax.resource.spi.ManagedConnection
javax.resource.ResourceException
- Thrown if an error occurspublic boolean checkValid()
True
if valid; otherwise false
public java.util.Properties getProperties()
public java.lang.AutoCloseable getConnection() throws java.lang.Exception
getConnection
in interface org.jboss.jca.core.spi.transaction.ConnectableResource
java.lang.Exception
protected void broadcastConnectionError(java.lang.Throwable e)
e
- The errorprotected org.jboss.logging.Logger getLog()
protected void checkState() throws java.sql.SQLException
java.sql.SQLException
- Thrown if an error occursprotected void checkException(java.sql.SQLException e) throws javax.resource.ResourceException
e
- The exceptionjavax.resource.ResourceException
- Thrown if an error occurspublic abstract boolean isXA()
Copyright © 2013 IronJacamar (http://www.ironjacamar.org)