Interface HandleSupplier

All Superinterfaces:

public interface HandleSupplier extends AutoCloseable
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.
    • getConfig

      ConfigRegistry getConfig()
      Returns the current Jdbi config.
      The current Jdbi configuration.
    • invokeInContext

      <V> V invokeInContext(ExtensionContext extensionContext, Callable<V> task) throws Exception
      Bind a new ExtensionContext to the Handle, invoke the given task, then restore the Handle's extension state.
      Type Parameters:
      V - the result type of the task
      extensionContext - An ExtensionContext object that manages the extension state.
      task - the code to execute in an extension context
      the callable's result
      Exception - if any exception is thrown
    • close

      default void close()
      Specified by:
      close in interface AutoCloseable