Class RepositoryInstaller

  • All Implemented Interfaces:
    ru.vyarus.dropwizard.guice.module.installer.FeatureInstaller, ru.vyarus.dropwizard.guice.module.installer.install.binding.BindingInstaller

    public class RepositoryInstaller
    extends java.lang.Object
    implements ru.vyarus.dropwizard.guice.module.installer.FeatureInstaller, ru.vyarus.dropwizard.guice.module.installer.install.binding.BindingInstaller
    Recognize classes annotated with JdbiRepository and register them. Such classes may be then injected as usual beans and used as usual daos. All daos will participate in the thread-bound transaction, declared by transaction annotation, transaction template or manually with unit manager.

    Dao may use any guice-related annotations because beans participate in guice aop. This is done by creating special guice-managed proxy class (where guice could apply aop). These proxies delegate all method calls to JDBI-managed proxies.

    Since:
    4.12.2016
    See Also:
    default annotation, for template usage, for low level usage without transaction
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void bind​(com.google.inject.Binder binder, java.lang.Class<?> type, boolean lazy)  
      void extensionBound​(com.google.inject.Stage stage, java.lang.Class<?> type)  
      <T> void manualBinding​(com.google.inject.Binder binder, java.lang.Class<T> type, com.google.inject.Binding<T> binding)  
      boolean matches​(java.lang.Class<?> type)  
      void report()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RepositoryInstaller

        public RepositoryInstaller()
    • Method Detail

      • matches

        public boolean matches​(java.lang.Class<?> type)
        Specified by:
        matches in interface ru.vyarus.dropwizard.guice.module.installer.FeatureInstaller
      • bind

        public void bind​(com.google.inject.Binder binder,
                         java.lang.Class<?> type,
                         boolean lazy)
        Specified by:
        bind in interface ru.vyarus.dropwizard.guice.module.installer.install.binding.BindingInstaller
      • manualBinding

        public <T> void manualBinding​(com.google.inject.Binder binder,
                                      java.lang.Class<T> type,
                                      com.google.inject.Binding<T> binding)
        Specified by:
        manualBinding in interface ru.vyarus.dropwizard.guice.module.installer.install.binding.BindingInstaller
      • extensionBound

        public void extensionBound​(com.google.inject.Stage stage,
                                   java.lang.Class<?> type)
        Specified by:
        extensionBound in interface ru.vyarus.dropwizard.guice.module.installer.install.binding.BindingInstaller
      • report

        public void report()
        Specified by:
        report in interface ru.vyarus.dropwizard.guice.module.installer.FeatureInstaller