Class ModulesAnalyzedEvent
java.lang.Object
ru.vyarus.dropwizard.guice.module.lifecycle.event.GuiceyLifecycleEvent
ru.vyarus.dropwizard.guice.module.lifecycle.event.ConfigurationPhaseEvent
ru.vyarus.dropwizard.guice.module.lifecycle.event.RunPhaseEvent
ru.vyarus.dropwizard.guice.module.lifecycle.event.run.ModulesAnalyzedEvent
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 Summary
ConstructorsConstructorDescriptionModulesAnalyzedEvent(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. -
Method Summary
Modifier and TypeMethodDescriptionList<com.google.inject.Module>List<com.google.inject.Binding>If extension is declared manually in guice module and extension is disabled then binding directly removed under bindings analysis.Guice disables mechanism may directly remove upper level modules, but to to remove modules, installed by top level modules bindings analysis is required.Methods inherited from class ru.vyarus.dropwizard.guice.module.lifecycle.event.RunPhaseEvent
getConfiguration, getConfigurationTree, getEnvironment, renderConfigurationBindingsMethods inherited from class ru.vyarus.dropwizard.guice.module.lifecycle.event.ConfigurationPhaseEvent
getBootstrapMethods inherited from class ru.vyarus.dropwizard.guice.module.lifecycle.event.GuiceyLifecycleEvent
getOptions, getSharedState, getStats, getType
-
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 contextanalyzedModules- modulesextensions- resolved extensionstransitiveModulesRemoved- removed modulesbindingsRemoved- removed bindings
-
-
Method Details
-
getAnalyzedModules
- Returns:
- list of module instances used for analysis or empty list
-
getExtensions
- Returns:
- all registered manual extensions (including possibly disabled in the future)
-
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
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
-