D
- C
- public abstract class AbstractPooledConnectionInvocationHandler<D,C extends javax.sql.PooledConnection> extends AbstractChildInvocationHandler<D,D,C>
AbstractInvocationHandler.SimpleInvoker
cluster, logger
Modifier | Constructor and Description |
---|---|
protected |
AbstractPooledConnectionInvocationHandler(D dataSource,
SQLProxy<D,D> proxy,
Invoker<D,D,C> invoker,
java.lang.Class<C> proxyClass,
java.util.Map<Database<D>,C> objectMap) |
Modifier and Type | Method and Description |
---|---|
protected void |
close(D dataSource,
C connection) |
protected abstract TransactionContext<D> |
createTransactionContext() |
protected InvocationStrategy<D,C,?> |
getInvocationStrategy(C connection,
java.lang.reflect.Method method,
java.lang.Object[] parameters)
Returns the appropriate
InvocationStrategy for the specified method. |
protected void |
postInvoke(C connection,
java.lang.reflect.Method method,
java.lang.Object[] parameters)
Called after method is invoked.
|
protected void |
record(Invoker<D,C,?> invoker,
java.lang.reflect.Method method,
java.lang.Object[] parameters) |
protected void |
replay(Database<D> database,
C connection) |
close, createObject, getParent, getParentProxy, getRoot
addChild, detectClusterPanic, entries, entry, getDatabaseCluster, getInvoker, getObject, handleFailure, handleFailures, handlePartialFailure, invoke, isRecordable, isSQLMethod, removeChild, removeChildren, retain
protected AbstractPooledConnectionInvocationHandler(D dataSource, SQLProxy<D,D> proxy, Invoker<D,D,C> invoker, java.lang.Class<C> proxyClass, java.util.Map<Database<D>,C> objectMap) throws java.lang.Exception
dataSource
- proxy
- invoker
- proxyClass
- objectMap
- java.lang.Exception
protected InvocationStrategy<D,C,?> getInvocationStrategy(C connection, java.lang.reflect.Method method, java.lang.Object[] parameters) throws java.lang.Exception
AbstractInvocationHandler
InvocationStrategy
for the specified method.
This implementation detects Wrapper
methods; and Object.equals(java.lang.Object)
, Object.hashCode()
, and Object.toString()
.
Default invocation strategy is DatabaseWriteInvocationStrategy
.getInvocationStrategy
in class AbstractInvocationHandler<D,C extends javax.sql.PooledConnection>
connection
- the proxied objectmethod
- the method to invokeparameters
- the method invocation parametersjava.lang.Exception
protected void postInvoke(C connection, java.lang.reflect.Method method, java.lang.Object[] parameters)
AbstractInvocationHandler
postInvoke
in class AbstractInvocationHandler<D,C extends javax.sql.PooledConnection>
connection
- the proxied objectmethod
- the method that was just invokedparameters
- the parameters of the method that was just invokedprotected void close(D dataSource, C connection) throws java.sql.SQLException
close
in class AbstractChildInvocationHandler<D,D,C extends javax.sql.PooledConnection>
java.sql.SQLException
AbstractChildInvocationHandler.close(java.lang.Object, java.lang.Object)
protected abstract TransactionContext<D> createTransactionContext()
protected void record(Invoker<D,C,?> invoker, java.lang.reflect.Method method, java.lang.Object[] parameters)
record
in class AbstractInvocationHandler<D,C extends javax.sql.PooledConnection>
AbstractInvocationHandler.record(net.sf.hajdbc.sql.Invoker, java.lang.reflect.Method, java.lang.Object[])
protected void replay(Database<D> database, C connection) throws java.lang.Exception
replay
in class AbstractInvocationHandler<D,C extends javax.sql.PooledConnection>
java.lang.Exception
AbstractInvocationHandler.replay(net.sf.hajdbc.Database, java.lang.Object)