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>,WebInstaller,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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbindInGuice(com.google.inject.Binder binder, Class<?> type) Bind to guice context.protected booleanisForceSingleton(Class<?> type, boolean hkManaged) Singleton binding should not be forced if bean has explicit scope declaration.protected booleanisJerseyExtension(Class<?> type) protected booleanChecks 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, setOptionsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ru.vyarus.dropwizard.guice.module.installer.FeatureInstaller
getRecognizableSigns, matches, reportMethods inherited from interface ru.vyarus.dropwizard.guice.module.installer.install.JerseyInstaller
install
-
Field Details
-
logger
protected final org.slf4j.Logger loggerShared logger.
-
-
Constructor Details
-
AbstractJerseyInstaller
public AbstractJerseyInstaller()
-
-
Method Details
-
isLazy
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
- Parameters:
type- extension type- Returns:
- true if extension should be managed by hk, false to manage by guice
-
bindInGuice
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
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
-