Package org.firebirdsql.ds
Class XAConnectionHandler
- java.lang.Object
- 
- org.firebirdsql.ds.XAConnectionHandler
 
- 
- All Implemented Interfaces:
- java.lang.reflect.InvocationHandler
 
 public class XAConnectionHandler extends java.lang.ObjectInvocationHandler for the logical connection returned by FBXAConnection.- Since:
- 2.2
- Author:
- Mark Rotteveel
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected static java.lang.StringCLOSED_MESSAGEprotected java.sql.Connectionconnectionprotected booleanforcedCloseprotected static java.lang.StringFORCIBLY_CLOSED_MESSAGEprotected FBPooledConnectionownerprotected java.sql.Connectionproxy
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedXAConnectionHandler(java.sql.Connection connection, FBXAConnection owner)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidclose()Closes this PooledConnectionHandler.protected voidcloseStatements()protected voidforgetStatement(org.firebirdsql.ds.StatementHandler stmtHandler)protected java.sql.ConnectiongetProxy()protected voidhandleClose(boolean notifyOwner)HandleConnection.close()method.java.lang.Objectinvoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)protected booleanisClosed()protected booleanisRollbackAllowed()Method to decide if calling rollback on the physical connection for cleanup (in handleClose()) is allowed.protected voidstatementErrorOccurred(org.firebirdsql.ds.StatementHandler stmtHandler, java.sql.SQLException sqle)
 
- 
- 
- 
Field Detail- 
CLOSED_MESSAGEprotected static final java.lang.String CLOSED_MESSAGE - See Also:
- Constant Field Values
 
 - 
FORCIBLY_CLOSED_MESSAGEprotected static final java.lang.String FORCIBLY_CLOSED_MESSAGE - See Also:
- Constant Field Values
 
 - 
ownerprotected final FBPooledConnection owner 
 - 
connectionprotected volatile java.sql.Connection connection 
 - 
proxyprotected volatile java.sql.Connection proxy 
 - 
forcedCloseprotected volatile boolean forcedClose 
 
- 
 - 
Constructor Detail- 
XAConnectionHandlerprotected XAConnectionHandler(java.sql.Connection connection, FBXAConnection owner)
 
- 
 - 
Method Detail- 
isRollbackAllowedprotected boolean isRollbackAllowed() throws java.sql.SQLExceptionMethod to decide if calling rollback on the physical connection for cleanup (in handleClose()) is allowed.NOTE: This method is not involved in rollback decisions for calls to the proxy. - Returns:
- truewhen calling rollback is allowed
- Throws:
- java.sql.SQLException
 
 - 
invokepublic java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable- Specified by:
- invokein interface- java.lang.reflect.InvocationHandler
- Throws:
- java.lang.Throwable
 
 - 
handleCloseprotected void handleClose(boolean notifyOwner) throws java.sql.SQLExceptionHandleConnection.close()method. This implementation closes the connection and associated statements.- Parameters:
- notifyOwner-- truewhen connection owner should be notified of closure.
- Throws:
- java.sql.SQLException- if underlying connection threw an exception.
 
 - 
getProxyprotected java.sql.Connection getProxy() - Returns:
- Proxy for the Connection object
 
 - 
closeprotected void close() throws java.sql.SQLExceptionCloses this PooledConnectionHandler. Intended to be called by the ConnectionPoolDataSource when it wants to forcibly close the logical connection to reuse it.- Throws:
- java.sql.SQLException
 
 - 
isClosedprotected boolean isClosed() 
 - 
statementErrorOccurredprotected void statementErrorOccurred(org.firebirdsql.ds.StatementHandler stmtHandler, java.sql.SQLException sqle)
 - 
forgetStatementprotected void forgetStatement(org.firebirdsql.ds.StatementHandler stmtHandler) 
 - 
closeStatementsprotected void closeStatements() throws java.sql.SQLException- Throws:
- java.sql.SQLException
 
 
- 
 
-