public final class ConnectionCallbackHandler extends Object
Connection.| Modifier and Type | Class and Description | 
|---|---|
static interface  | 
CallbackHandlerSupport.MethodInvocationStrategy
Strategy to invoke the original instance(non-proxy) and retrieve result. 
 | 
| Modifier and Type | Field and Description | 
|---|---|
protected static CallbackHandlerSupport.MethodInvocationStrategy | 
DEFAULT_INVOCATION_STRATEGY  | 
protected CallbackHandlerSupport.MethodInvocationStrategy | 
methodInvocationStrategy  | 
protected ProxyConfig | 
proxyConfig  | 
| Constructor and Description | 
|---|
ConnectionCallbackHandler(io.r2dbc.spi.Connection connection,
                         ConnectionInfo connectionInfo,
                         ProxyConfig proxyConfig)  | 
| Modifier and Type | Method and Description | 
|---|---|
protected Object | 
handleCommonMethod(String methodName,
                  Object original,
                  Object[] args,
                  io.r2dbc.spi.Connection originalConnection)  | 
protected Flux<? extends io.r2dbc.spi.Result> | 
interceptQueryExecution(Publisher<? extends io.r2dbc.spi.Result> publisher,
                       io.r2dbc.proxy.callback.MutableQueryExecutionInfo executionInfo)
Augment query execution result to hook up listener lifecycle. 
 | 
Object | 
invoke(Object proxy,
      Method method,
      Object[] args)
When proxy is invoked, actual implementation of the proxy handler delegates the
 invocation to this method. 
 | 
protected boolean | 
isCommonMethod(String methodName)  | 
protected Object | 
proceedExecution(Method method,
                Object target,
                Object[] args,
                ProxyExecutionListener listener,
                ConnectionInfo connectionInfo,
                Consumer<MethodExecutionInfo> onComplete)
Augment method invocation and call method listener. 
 | 
void | 
setMethodInvocationStrategy(CallbackHandlerSupport.MethodInvocationStrategy methodInvocationStrategy)
Set  
CallbackHandlerSupport.MethodInvocationStrategy to invoke the original instance(non-proxy) and retrieve result. | 
protected static final CallbackHandlerSupport.MethodInvocationStrategy DEFAULT_INVOCATION_STRATEGY
protected final ProxyConfig proxyConfig
protected CallbackHandlerSupport.MethodInvocationStrategy methodInvocationStrategy
public ConnectionCallbackHandler(io.r2dbc.spi.Connection connection,
                                 ConnectionInfo connectionInfo,
                                 ProxyConfig proxyConfig)
public Object invoke(Object proxy, Method method, @Nullable Object[] args) throws Throwable
CallbackHandlerproxy - the proxy instance that the method was invoked onmethod - the method that has invoked on the proxy instanceargs - an array of objects that has passed to the method invocation.
               this can be null when method is invoked with no argument.null.)Throwable - the exception thrown from the method invocation on the proxy instance.IllegalArgumentException - if proxy is nullprotected boolean isCommonMethod(String methodName)
@Nullable protected Object handleCommonMethod(String methodName, Object original, @Nullable Object[] args, @Nullable io.r2dbc.spi.Connection originalConnection)
protected Object proceedExecution(Method method, Object target, @Nullable Object[] args, ProxyExecutionListener listener, @Nullable ConnectionInfo connectionInfo, @Nullable Consumer<MethodExecutionInfo> onComplete) throws Throwable
method - method to invoke on targettarget - an object being invokedargs - arguments for the method. null if the method doesn't take any arguments.listener - listener that before/after method callbacks will be calledconnectionInfo - current connection information. null when invoked operation is not associated to the Connection.onComplete - a callback that will be invoked at successful termination(onComplete) of the result publisher.Throwable - thrown exception during the invocationIllegalArgumentException - if method is nullIllegalArgumentException - if target is nullIllegalArgumentException - if listener is nullprotected Flux<? extends io.r2dbc.spi.Result> interceptQueryExecution(Publisher<? extends io.r2dbc.spi.Result> publisher, io.r2dbc.proxy.callback.MutableQueryExecutionInfo executionInfo)
publisher - query invocation result publisherexecutionInfo - query execution context infoIllegalArgumentException - if flux is nullIllegalArgumentException - if executionInfo is nullpublic void setMethodInvocationStrategy(CallbackHandlerSupport.MethodInvocationStrategy methodInvocationStrategy)
CallbackHandlerSupport.MethodInvocationStrategy to invoke the original instance(non-proxy) and retrieve result.methodInvocationStrategy - strategy for method invocationIllegalArgumentException - if methodInvocationStrategy is nullCallbackHandlerSupport.MethodInvocationStrategyCopyright © 2025. All rights reserved.