Interface ExtensionFactory

All Known Implementing Classes:
SqlObjectFactory

public interface ExtensionFactory
Factory interface used to produce Jdbi extension objects.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    accepts​(Class<?> extensionType)
     
    <E> E
    attach​(Class<E> extensionType, HandleSupplier handle)
     
  • Method Details

    • accepts

      boolean accepts(Class<?> extensionType)
      Parameters:
      extensionType - the extension type
      Returns:
      whether the factory can produce an extension of the given type
    • attach

      <E> E attach(Class<E> extensionType, HandleSupplier handle)
      Type Parameters:
      E - the extension type
      Parameters:
      extensionType - the extension type.
      handle - Supplies the database handle. This supplier may lazily open a Handle on the first invocation. Extension implementors should take care not to fetch the handle before it is needed, to avoid opening handles unnecessarily.
      Returns:
      an extension of the given type, attached to the given handle.
      Throws:
      IllegalArgumentException - if the extension type is not supported by this factory.
      See Also:
      Jdbi.onDemand(Class)