public class XAConnectionWrapper
extends java.lang.Object
implements javax.sql.XAConnection
XAConnection that exposes the wrapper's plugin pipeline to the application while
delegating the XA control surface to the target driver's XAConnection.
Per the JDBC PooledConnection contract, each getConnection() returns a new
logical connection over the same physical XA connection, and the previous logical connection is
closed. In this implementation each logical handle is a fresh ConnectionWrapper with its
own plugin pipeline (built by logicalConnectionBuilder), so no plugin state leaks between
successive checkouts. The physical XA connection is owned by the
XADataSourceConnectionProvider and reused across handles.
| Modifier and Type | Class and Description |
|---|---|
static interface |
XAConnectionWrapper.LogicalConnectionBuilder
Builds a fresh logical connection (a
ConnectionWrapper with a fresh pipeline). |
| Constructor and Description |
|---|
XAConnectionWrapper(XADataSourceConnectionProvider provider,
XAConnectionWrapper.LogicalConnectionBuilder logicalConnectionBuilder) |
| Modifier and Type | Method and Description |
|---|---|
void |
addConnectionEventListener(javax.sql.ConnectionEventListener listener) |
void |
addStatementEventListener(javax.sql.StatementEventListener listener) |
void |
close() |
java.sql.Connection |
getConnection() |
javax.transaction.xa.XAResource |
getXAResource() |
void |
removeConnectionEventListener(javax.sql.ConnectionEventListener listener) |
void |
removeStatementEventListener(javax.sql.StatementEventListener listener) |
public XAConnectionWrapper(XADataSourceConnectionProvider provider, XAConnectionWrapper.LogicalConnectionBuilder logicalConnectionBuilder)
public java.sql.Connection getConnection()
throws java.sql.SQLException
getConnection in interface javax.sql.PooledConnectionjava.sql.SQLExceptionpublic javax.transaction.xa.XAResource getXAResource()
throws java.sql.SQLException
getXAResource in interface javax.sql.XAConnectionjava.sql.SQLExceptionpublic void close()
throws java.sql.SQLException
close in interface javax.sql.PooledConnectionjava.sql.SQLExceptionpublic void addConnectionEventListener(javax.sql.ConnectionEventListener listener)
addConnectionEventListener in interface javax.sql.PooledConnectionpublic void removeConnectionEventListener(javax.sql.ConnectionEventListener listener)
removeConnectionEventListener in interface javax.sql.PooledConnectionpublic void addStatementEventListener(javax.sql.StatementEventListener listener)
addStatementEventListener in interface javax.sql.PooledConnectionpublic void removeStatementEventListener(javax.sql.StatementEventListener listener)
removeStatementEventListener in interface javax.sql.PooledConnection