Class AbstractJerseyInstaller<T>
- java.lang.Object
-
- ru.vyarus.dropwizard.guice.module.installer.option.InstallerOptionsSupport
-
- ru.vyarus.dropwizard.guice.module.installer.feature.jersey.AbstractJerseyInstaller<T>
-
- Type Parameters:
T
- extensions type
- All Implemented Interfaces:
FeatureInstaller
,JerseyInstaller<T>
,WithOptions
- Direct Known Subclasses:
JerseyProviderInstaller
,ResourceInstaller
public abstract class AbstractJerseyInstaller<T> extends InstallerOptionsSupport implements FeatureInstaller, JerseyInstaller<T>
Base class for jersey installers (JerseyInstaller
). Provides common utilities.- Since:
- 28.04.2018
-
-
Field Summary
Fields Modifier and Type Field Description protected org.slf4j.Logger
logger
-
Constructor Summary
Constructors Constructor Description AbstractJerseyInstaller()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
bindInGuice(com.google.inject.Binder binder, java.lang.Class<?> type)
Bind to guice context.protected boolean
isForceSingleton(java.lang.Class<?> type, boolean hkManaged)
Singleton binding should not be forced if bean has explicit scope declaration.protected boolean
isJerseyExtension(java.lang.Class<?> type)
protected boolean
isLazy(java.lang.Class<?> type, boolean lazy)
Checks if lazy flag could be counted (only when extension is managed by guice).-
Methods inherited from class ru.vyarus.dropwizard.guice.module.installer.option.InstallerOptionsSupport
option, setOptions
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ru.vyarus.dropwizard.guice.module.installer.FeatureInstaller
getRecognizableSigns, matches, report
-
Methods inherited from interface ru.vyarus.dropwizard.guice.module.installer.install.JerseyInstaller
install
-
-
-
-
Method Detail
-
isLazy
protected boolean isLazy(java.lang.Class<?> type, boolean lazy)
Checks if lazy flag could be counted (only when extension is managed by guice). Prints warning in case of incorrect lazy marker usage.- Parameters:
type
- extension typelazy
- lazy marker (annotation presence)- Returns:
- lazy marker if guice managed type and false when hk managed.
-
isJerseyExtension
protected boolean isJerseyExtension(java.lang.Class<?> type)
- Parameters:
type
- extension type- Returns:
- true if extension should be managed by hk, false to manage by guice
-
bindInGuice
protected void bindInGuice(com.google.inject.Binder binder, java.lang.Class<?> type)
Bind to guice context. Singleton scope will be forced if it's not disabled (InstallersOptions.ForceSingletonForJerseyExtensions
) and if no explicit scope is declared with annotation on bean.- Parameters:
binder
- guice bindertype
- extension type
-
isForceSingleton
protected boolean isForceSingleton(java.lang.Class<?> type, boolean hkManaged)
Singleton binding should not be forced if bean has explicit scope declaration.- Parameters:
type
- bean typehkManaged
- true if bean is going to be managed by hk, false for guice management- Returns:
- true to force singleton bindings for hk extensions (resources, filters etc), false otherwise
-
-