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 Details

    • logger

      protected final org.slf4j.Logger logger
      Shared logger.
  • Constructor Details

    • AbstractJerseyInstaller

      public AbstractJerseyInstaller()
  • Method Details

    • isLazy

      protected boolean isLazy(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 type
      lazy - lazy marker (annotation presence)
      Returns:
      lazy marker if guice managed type and false when hk managed.
    • isJerseyExtension

      protected boolean isJerseyExtension(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, 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 binder
      type - extension type
    • isForceSingleton

      protected boolean isForceSingleton(Class<?> type, boolean hkManaged)
      Singleton binding should not be forced if bean has explicit scope declaration.
      Parameters:
      type - bean type
      hkManaged - 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