public abstract class BaseWrapperManagedConnection extends Object implements javax.resource.spi.ManagedConnection, org.jboss.jca.core.spi.transaction.ConnectableResource
Modifier and Type | Field and Description |
---|---|
protected static org.jboss.jca.adapters.AdaptersBundle |
bundle
The bundle
|
protected Connection |
con
The connection
|
protected boolean |
destroyed
Destroyed
|
protected static boolean |
ignoreInManagedAutoCommitCalls
Ignore in managed auto commit calls
|
protected 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 Properties |
props
The properties
|
protected Object |
stateLock
The state lock
|
protected boolean |
underlyingAutoCommit
Underlying auto-commit
|
protected boolean |
underlyingReadOnly
Underlying read-only
|
Constructor and Description |
---|
BaseWrapperManagedConnection(BaseWrapperManagedConnectionFactory mcf,
Connection con,
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(Object handle)
Associate a handle
|
protected void |
broadcastConnectionError(Throwable e)
Broad cast a connection error
|
protected void |
checkException(SQLException e)
Check exception
|
protected void |
checkState()
Check state
|
boolean |
checkValid()
Check valid
|
void |
cleanup() |
void |
destroy()
Destroy
|
Object |
getConnection() |
Object |
getConnection(Subject subject,
javax.resource.spi.ConnectionRequestInfo cri)
Get a connection
|
protected org.jboss.jca.adapters.AdaptersLogger |
getLog()
Get the logger
|
PrintWriter |
getLogWriter() |
javax.resource.spi.ManagedConnectionMetaData |
getMetaData() |
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 |
setConnectableResourceListener(org.jboss.jca.core.spi.transaction.ConnectableResourceListener crl) |
void |
setLogWriter(PrintWriter param1) |
protected void |
tryLock()
Try lock
|
protected void |
unlock()
Unlock
|
protected static org.jboss.jca.adapters.AdaptersBundle bundle
protected final BaseWrapperManagedConnectionFactory mcf
protected final Connection con
protected Properties props
protected final Object stateLock
protected boolean inManagedTransaction
protected 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, Connection con, Properties props, int transactionIsolation, int psCacheSize) throws SQLException
mcf
- The managed connection factorycon
- The connectionprops
- The propertiestransactionIsolation
- The transaction isolationpsCacheSize
- The prepared statement cache sizeSQLException
- 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(Object handle) throws javax.resource.ResourceException
associateConnection
in interface javax.resource.spi.ManagedConnection
handle
- The handlejavax.resource.ResourceException
- Thrown if an error occurspublic 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(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 SQLException
SQLException
- Thrown if a lock can't be obtainedprotected void unlock()
public Object getConnection(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 Properties getProperties()
public Object getConnection() throws Exception
getConnection
in interface org.jboss.jca.core.spi.transaction.ConnectableResource
Exception
public void setConnectableResourceListener(org.jboss.jca.core.spi.transaction.ConnectableResourceListener crl)
setConnectableResourceListener
in interface org.jboss.jca.core.spi.transaction.ConnectableResource
protected void broadcastConnectionError(Throwable e)
e
- The errorprotected org.jboss.jca.adapters.AdaptersLogger getLog()
protected void checkState() throws SQLException
SQLException
- Thrown if an error occursprotected void checkException(SQLException e) throws javax.resource.ResourceException
e
- The exceptionjavax.resource.ResourceException
- Thrown if an error occurspublic abstract boolean isXA()
Copyright © 2014 IronJacamar (http://www.ironjacamar.org)