Class InjectionHandlerFactory

java.lang.Object
ru.vyarus.guicey.jdbi3.inject.InjectionHandlerFactory
All Implemented Interfaces:
org.jdbi.v3.core.extension.ExtensionHandlerFactory

public class InjectionHandlerFactory extends Object implements org.jdbi.v3.core.extension.ExtensionHandlerFactory
Sql objects are forced to be interfaces now so it is impossible to inject guice bean (probably other proxy) with field injection. In order to workaround this limitation getter injection must be used: @Inject MyBean getBean();. Handler detects methods annotated with Inject or Inject and return actual guice bean on method call.
Since:
17.09.2018
  • Constructor Details

    • InjectionHandlerFactory

      public InjectionHandlerFactory()
  • Method Details

    • accepts

      public boolean accepts(Class<?> extensionType, Method method)
      Specified by:
      accepts in interface org.jdbi.v3.core.extension.ExtensionHandlerFactory
    • createExtensionHandler

      public Optional<org.jdbi.v3.core.extension.ExtensionHandler> createExtensionHandler(Class<?> extensionType, Method method)
      Specified by:
      createExtensionHandler in interface org.jdbi.v3.core.extension.ExtensionHandlerFactory