Interface HandleSupplier

All Superinterfaces:

public interface HandleSupplier extends Configurable<HandleSupplier>
A handle supplier for extension implementors.
  • Method Details

    • getHandle

      Handle getHandle()
      Returns a handle, possibly creating it lazily. A Handle holds a database connection, so extensions should only call this method in order to interact with the database.
      an open Handle
    • getJdbi

      Jdbi getJdbi()
      Returns the owning Jdbi instance.
      the owning Jdbi instance.
    • invokeInContext

      <V> V invokeInContext(ExtensionMethod extensionMethod, ConfigRegistry config, Callable<V> task) throws Exception
      Bind an extension method and configuration registry to the Handle, invoke the given task, then reset the Handle's extension state. Note that the binding is done by a thread local, so the binding will not propagate to other threads you may call out to.
      Type Parameters:
      V - the result type of the task
      extensionMethod - the method invoked
      config - the configuration registry
      task - the code to execute in an extension context
      the callable's result
      Exception - if any exception is thrown