Interface GuiceRole

All Known Implementing Classes:
AutoJAXRSBindingGuiceRole, BindEagerSingletonRole, DbunitGuiceRole, HibernateAutoGuiceRole, InternalConfigPropertyDocumenterGuiceRole, MetricsServiceAutoRegisterRole, NetworkConfigGuiceRole, OkHttpAutoClientRole, UserManagerAuthenticationGuiceRole, WebappGuiceRole

public interface GuiceRole
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Provides an opportunity, pre-compositing, to influence the configuration sources and order.
    void
    injectorCreated(com.google.inject.Stage stage, ClassScannerFactory scannerFactory, GuiceConfig config, GuiceSetup setup, List<com.google.inject.Module> modules, AtomicReference<com.google.inject.Injector> injectorRef, com.codahale.metrics.MetricRegistry metrics)
    Called once the Injector has been created
    void
    register(com.google.inject.Stage stage, ClassScannerFactory scannerFactory, GuiceConfig config, GuiceSetup setup, List<com.google.inject.Module> modules, AtomicReference<com.google.inject.Injector> injectorRef, com.codahale.metrics.MetricRegistry metrics)
    Provides an opportunity to influence modules (adding, removing, reordering) being loaded.
  • Method Details

    • adjustConfigurations

      void adjustConfigurations(List<PropertyFile> configs)
      Provides an opportunity, pre-compositing, to influence the configuration sources and order. Configuration sources earlier in this list will be overridden by configuration sources later in the list.

      Called before register(Stage, ClassScannerFactory, GuiceConfig, GuiceSetup, List, AtomicReference, MetricRegistry)

      Parameters:
      configs -
    • register

      void register(com.google.inject.Stage stage, ClassScannerFactory scannerFactory, GuiceConfig config, GuiceSetup setup, List<com.google.inject.Module> modules, AtomicReference<com.google.inject.Injector> injectorRef, com.codahale.metrics.MetricRegistry metrics)
      Provides an opportunity to influence modules (adding, removing, reordering) being loaded. Called before the GuiceSetup class has loaded its modules.

      Called before injectorCreated(Stage, ClassScannerFactory, GuiceConfig, GuiceSetup, List, AtomicReference, MetricRegistry)

      Parameters:
      stage -
      scannerFactory - a factory for a classpath scanner for the user application classes. Implementations should not hold on to this for long (to save memory usage)
      config -
      setup -
      modules -
      injectorRef - a reference which will be updated to contain the Injector once the guice environment has been set up
      metrics - the MetricsRegistry for environment-wide metrics
    • injectorCreated

      void injectorCreated(com.google.inject.Stage stage, ClassScannerFactory scannerFactory, GuiceConfig config, GuiceSetup setup, List<com.google.inject.Module> modules, AtomicReference<com.google.inject.Injector> injectorRef, com.codahale.metrics.MetricRegistry metrics)
      Called once the Injector has been created
      Parameters:
      stage -
      scannerFactory - a factory for a classpath scanner for the user application classes. Implementations should not hold on to this for long (to save memory usage)
      config -
      setup -
      modules - the final list of modules in use
      injectorRef - the reference to the injector, must contain a non-null value
      metrics - the MetricsRegistry for environment-wide metrics