Package org.jdbi.v3.core.extension
Class ExtensionMetadata.ExtensionHandlerInvoker
- java.lang.Object
-
- org.jdbi.v3.core.extension.ExtensionMetadata.ExtensionHandlerInvoker
-
- Enclosing class:
- ExtensionMetadata
public final class ExtensionMetadata.ExtensionHandlerInvoker extends java.lang.ObjectWraps all config customizers and the handler for a specific method execution. An invoker is created usingExtensionMetadata.createExtensionHandlerInvoker(Object, Method, HandleSupplier, ConfigRegistry).
-
-
Field Summary
Fields Modifier and Type Field Description private ExtensionContextextensionContextprivate ExtensionHandlerextensionHandlerprivate HandleSupplierhandleSupplierprivate java.lang.Objecttarget
-
Constructor Summary
Constructors Constructor Description ExtensionHandlerInvoker(java.lang.Object target, java.lang.reflect.Method method, ExtensionHandler extensionHandler, HandleSupplier handleSupplier, ConfigRegistry config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcall(java.lang.Runnable runnable)Invoke a runnable in the extension context.java.lang.Objectcall(java.util.concurrent.Callable<?> callable)Invoke a callable in the extension context.java.lang.Objectinvoke(java.lang.Object... args)Invoke the registered extension handler code in the extension context.
-
-
-
Field Detail
-
target
private final java.lang.Object target
-
handleSupplier
private final HandleSupplier handleSupplier
-
extensionContext
private final ExtensionContext extensionContext
-
extensionHandler
private final ExtensionHandler extensionHandler
-
-
Constructor Detail
-
ExtensionHandlerInvoker
ExtensionHandlerInvoker(java.lang.Object target, java.lang.reflect.Method method, ExtensionHandler extensionHandler, HandleSupplier handleSupplier, ConfigRegistry config)
-
-
Method Detail
-
invoke
public java.lang.Object invoke(java.lang.Object... args)
Invoke the registered extension handler code in the extension context. The extension context wraps the method that gets executed and a full customized configuration (both instance and method specific configuration customizers have been applied). The extension context is registered with the underlying handle to configure the handle when executing the registeredExtensionHandler.- Parameters:
args- The arguments to pass into the extension handler- Returns:
- The result of the extension handler invocation
-
call
public java.lang.Object call(java.util.concurrent.Callable<?> callable)
Invoke a callable in the extension context. The extension context wraps the method that gets executed and a full customized configuration (both instance and method specific configuration customizers have been applied). The extension context is registered with the underlying handle to configure the handle when calling theCallable.call()method.
This method is used by the generated classes from thejdbi3-generatorannotation processor to execute predefinedExtensionHandlerinstances.- Parameters:
callable- The callable to use- Returns:
- The result of the extension handler invocation
-
call
public void call(java.lang.Runnable runnable)
Invoke a runnable in the extension context. The extension context wraps the method that gets executed and a full customized configuration (both instance and method specific configuration customizers have been applied). The extension context is registered with the underlying handle to configure the handle when calling theRunnable.run()method.
This method is used by the generated classes from thejdbi3-generatorannotation processor to execute predefinedExtensionHandlerinstances.- Parameters:
runnable- The runnable to use
-
-