D
- P
- public class ConnectionInvocationHandler<D,P> extends AbstractChildInvocationHandler<D,P,java.sql.Connection>
AbstractInvocationHandler.SimpleInvoker
cluster, logger
Constructor and Description |
---|
ConnectionInvocationHandler(P proxy,
SQLProxy<D,P> handler,
Invoker<D,P,java.sql.Connection> invoker,
java.util.Map<Database<D>,java.sql.Connection> connectionMap,
TransactionContext<D> transactionContext) |
Modifier and Type | Method and Description |
---|---|
protected void |
close(P parent,
java.sql.Connection connection) |
protected InvocationStrategy<D,java.sql.Connection,?> |
getInvocationStrategy(java.sql.Connection connection,
java.lang.reflect.Method method,
java.lang.Object[] parameters)
Returns the appropriate
InvocationStrategy for the specified method. |
protected Invoker<D,java.sql.Connection,?> |
getInvoker(java.sql.Connection connection,
java.lang.reflect.Method method,
java.lang.Object[] parameters)
Return the appropriate invoker for the specified method.
|
protected boolean |
isRecordable(java.lang.reflect.Method method) |
protected boolean |
isSQLMethod(java.lang.reflect.Method method)
Indicates whether or not the specified method accepts a SQL string as its first parameter.
|
protected void |
postInvoke(java.sql.Connection object,
java.lang.reflect.Method method,
java.lang.Object[] parameters)
Called after method is invoked.
|
close, createObject, getParent, getParentProxy, getRoot
addChild, detectClusterPanic, entries, entry, getDatabaseCluster, getObject, handleFailure, handleFailures, handlePartialFailure, invoke, record, removeChild, removeChildren, replay, retain
public ConnectionInvocationHandler(P proxy, SQLProxy<D,P> handler, Invoker<D,P,java.sql.Connection> invoker, java.util.Map<Database<D>,java.sql.Connection> connectionMap, TransactionContext<D> transactionContext) throws java.lang.Exception
proxy
- handler
- invoker
- connectionMap
- transactionContext
- java.lang.Exception
protected InvocationStrategy<D,java.sql.Connection,?> getInvocationStrategy(java.sql.Connection 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,java.sql.Connection>
connection
- the proxied objectmethod
- the method to invokeparameters
- the method invocation parametersjava.lang.Exception
AbstractInvocationHandler.getInvocationStrategy(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
protected Invoker<D,java.sql.Connection,?> getInvoker(java.sql.Connection connection, java.lang.reflect.Method method, java.lang.Object[] parameters) throws java.lang.Exception
AbstractInvocationHandler
getInvoker
in class AbstractInvocationHandler<D,java.sql.Connection>
java.lang.Exception
AbstractInvocationHandler.getInvoker(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
protected boolean isSQLMethod(java.lang.reflect.Method method)
AbstractInvocationHandler
isSQLMethod
in class AbstractInvocationHandler<D,java.sql.Connection>
method
- a methodAbstractInvocationHandler.isSQLMethod(java.lang.reflect.Method)
protected void postInvoke(java.sql.Connection object, java.lang.reflect.Method method, java.lang.Object[] parameters)
AbstractInvocationHandler
postInvoke
in class AbstractInvocationHandler<D,java.sql.Connection>
object
- the proxied objectmethod
- the method that was just invokedparameters
- the parameters of the method that was just invokedAbstractInvocationHandler.postInvoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
protected void close(P parent, java.sql.Connection connection) throws java.sql.SQLException
close
in class AbstractChildInvocationHandler<D,P,java.sql.Connection>
java.sql.SQLException
AbstractChildInvocationHandler.close(java.lang.Object, java.lang.Object)
protected boolean isRecordable(java.lang.reflect.Method method)
isRecordable
in class AbstractInvocationHandler<D,java.sql.Connection>
AbstractInvocationHandler.isRecordable(java.lang.reflect.Method)