Class RepositoryInstaller
- java.lang.Object
-
- ru.vyarus.guicey.jdbi3.installer.repository.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.BindingInstallerRecognize classes annotated withJdbiRepositoryand 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.
Manual guice bindings are not allowed, except one case:
bind(Base.class).to(Repo.class)whereRepo.classis a recognizable (annotated) repository. This case useful for generifying repositories (so implementation with exact queries could be pluggable).- Since:
- 31.08.2018
- See Also:
default annotation,for template usage,for low level usage without transaction
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRepositoryInstaller.JdbiProxyRedirectGuice interceptor redirects calls from guice repository bean into jdbi proxy instance.
-
Constructor Summary
Constructors Constructor Description RepositoryInstaller()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbind(com.google.inject.Binder binder, java.lang.Class<?> type, boolean lazy)voidextensionBound(com.google.inject.Stage stage, java.lang.Class<?> type)<T> voidmanualBinding(com.google.inject.Binder binder, java.lang.Class<T> type, com.google.inject.Binding<T> binding)booleanmatches(java.lang.Class<?> type)voidreport()
-
-
-
Method Detail
-
matches
public boolean matches(java.lang.Class<?> type)
- Specified by:
matchesin interfaceru.vyarus.dropwizard.guice.module.installer.FeatureInstaller
-
bind
public void bind(com.google.inject.Binder binder, java.lang.Class<?> type, boolean lazy)- Specified by:
bindin interfaceru.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:
manualBindingin interfaceru.vyarus.dropwizard.guice.module.installer.install.binding.BindingInstaller
-
extensionBound
public void extensionBound(com.google.inject.Stage stage, java.lang.Class<?> type)- Specified by:
extensionBoundin interfaceru.vyarus.dropwizard.guice.module.installer.install.binding.BindingInstaller
-
report
public void report()
- Specified by:
reportin interfaceru.vyarus.dropwizard.guice.module.installer.FeatureInstaller
-
-