Class ModulesAnalyzedEvent


public class ModulesAnalyzedEvent extends RunPhaseEvent
Called when guice bindings analyzed and all extensions detected. Provides list of all recognized binding extensions (including disabled), disabled transitive modules and extension bindings. Called only if bindings analysis is enabled.

May be used for consultation only. Extension instances are not yet available (guice context is not created).

Since:
01.09.2019
  • Constructor Details

    • ModulesAnalyzedEvent

      public ModulesAnalyzedEvent(EventsContext context, List<com.google.inject.Module> analyzedModules, List<Class<?>> extensions, List<Class<? extends com.google.inject.Module>> transitiveModulesRemoved, List<com.google.inject.Binding> bindingsRemoved)
      Create event.
      Parameters:
      context - event context
      analyzedModules - modules
      extensions - resolved extensions
      transitiveModulesRemoved - removed modules
      bindingsRemoved - removed bindings
  • Method Details

    • getAnalyzedModules

      public List<com.google.inject.Module> getAnalyzedModules()
      Returns:
      list of module instances used for analysis or empty list
    • getExtensions

      public List<Class<?>> getExtensions()
      Returns:
      all registered manual extensions (including possibly disabled in the future)
    • getTransitiveModulesRemoved

      public List<Class<? extends com.google.inject.Module>> getTransitiveModulesRemoved()
      Guice disables mechanism may directly remove upper level modules, but to to remove modules, installed by top level modules bindings analysis is required. This method returns only removed inner modules. It does not provide information of exact removed modules: multiple module instances may be registered with the same type and all of them will be removed.
      Returns:
      removed inner guice modules (after bindings analysis) or empty list
    • getBindingsRemoved

      public List<com.google.inject.Binding> getBindingsRemoved()
      If extension is declared manually in guice module and extension is disabled then binding directly removed under bindings analysis. Returned list exactly represent disabled extension bindings (removed). Note that disabled inner modules remove is essentially the same (removing all bindings sources in disabled module), but such bindings are not appear in this list (there could be too many of them and generally not interesting information).
      Returns:
      disabled extensions bindings removed or empty list