public <E> E onDemand(Class<E> extensionType) {
        if (!extensionType.isInterface()) {
            throw new IllegalArgumentException("On-demand extensions are only supported for interfaces.");
        }
        if (!getConfig(Extensions.class).hasExtensionFor(extensionType)) {
            throw new NoSuchExtensionException(extensionType);
        }

        return getConfig(OnDemandExtensions.class).create(this, extensionType);
    }
Creates an extension instance that uses the current {@link Jdbi} instance for database operations.

@param extensionType the type of extension. Must be a public interface type.
@param <E> the extension type

@return an extension which opens and closes handles (as needed) for individual method calls. Only public
interface types may be used as on-demand extensions.
core/src/main/java/org/jdbi/v3/core/Jdbi.java