Class InjectorCreationEvent
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.InjectorCreationEvent
Called just before guice injector creation. Provides all configured modules (main and override) and
all disabled modules. Called even if no modules were used at all (to indicate major lifecycle point).
Modules may be post-processed here (e.g. some special marker interface support may be implemented here).
- Since:
- 19.04.2018
-
Constructor Summary
ConstructorsConstructorDescriptionInjectorCreationEvent(EventsContext context, List<com.google.inject.Module> modules, List<com.google.inject.Module> overriding, List<com.google.inject.Module> disabled, List<com.google.inject.Module> ignored) Create event. -
Method Summary
Modifier and TypeMethodDescriptionList<com.google.inject.Module>List<com.google.inject.Module>List<com.google.inject.Module>NOTE: if bindings analysis is enabled (GuiceyOptions.AnalyzeGuiceModules) then these modules were already processed and repackaged (in order to remove disabled inner modules and extensions).List<com.google.inject.Module>In contrast to normal modules, which are repackaged during bindings analysis, overriding modules are always used as is and so instances may be modified (modules configuration called after this event).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
-
InjectorCreationEvent
public InjectorCreationEvent(EventsContext context, List<com.google.inject.Module> modules, List<com.google.inject.Module> overriding, List<com.google.inject.Module> disabled, List<com.google.inject.Module> ignored) Create event.- Parameters:
context- event contextmodules- modulesoverriding- overriding modulesdisabled- disabled modulesignored- ignored modules (duplicates)
-
-
Method Details
-
getModules
NOTE: if bindings analysis is enabled (GuiceyOptions.AnalyzeGuiceModules) then these modules were already processed and repackaged (in order to remove disabled inner modules and extensions). This list is useful for information only and any modifications to module instances makes no sense.- Returns:
- list of all enabled guice modules or empty list if no modules registered or all of them were disabled
-
getOverridingModules
In contrast to normal modules, which are repackaged during bindings analysis, overriding modules are always used as is and so instances may be modified (modules configuration called after this event).- Returns:
- list of all overriding guice modules or empty list if not overriding modules registered or all of them were disabled
-
getDisabled
- Returns:
- list of all disabled modules or empty list
-
getIgnored
- Returns:
- list of all ignored modules (duplicates) or empty list
-