Package ru.vyarus.dropwizard.guice.debug
Class LifecycleDiagnostic
- java.lang.Object
-
- ru.vyarus.dropwizard.guice.module.lifecycle.GuiceyLifecycleAdapter
-
- ru.vyarus.dropwizard.guice.module.lifecycle.UniqueGuiceyLifecycleListener
-
- ru.vyarus.dropwizard.guice.debug.LifecycleDiagnostic
-
- All Implemented Interfaces:
GuiceyLifecycleListener
public class LifecycleDiagnostic extends UniqueGuiceyLifecycleListener
Debug guicey lifecycle listener. Could be installed with bundle shortcut:GuiceBundle.Builder.printLifecyclePhases().Use system out instead of logger because logger in not initialized in time of first events and for more clarity.
Split logs with current phase name and startup timer. This should clarify custom logic execution times.
If multiple listeners registered, only first registered will be actually used (allow safe multiple registrations).
- Since:
- 17.04.2018
-
-
Constructor Summary
Constructors Constructor Description LifecycleDiagnostic(boolean showDetails)Create lifecycle diagnostic.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidapplicationRun(ApplicationRunEvent event)Called afterGuiceBundle.run(io.dropwizard.core.Configuration, io.dropwizard.core.setup.Environment)when guicey context is started, extensions installed (but not hk extensions, because neither jersey nor jetty isn't start yet).protected voidbundlesInitialized(BundlesInitializedEvent event)Called after bundles initialization.protected voidbundlesStarted(BundlesStartedEvent event)Called after bundles start (run method call).protected voidclasspathExtensionsResolved(ClasspathExtensionsResolvedEvent event)Called when classes from classpath scan analyzed and all extensions detected.protected voidcommandsResolved(CommandsResolvedEvent event)Called if commands search is enabled (GuiceBundle.Builder.searchCommands()) and at least one command found.protected voidconfigurationHooksProcessed(ConfigurationHooksProcessedEvent event)Appeared just in time ofGuiceBundle.Builder.build()after manual builder configuration and allGuiceyConfigurationHookprocessing.protected voiddropwizardBundlesInitialized(DropwizardBundlesInitializedEvent event)Called after dropwizard bundles initialization (for dropwizard bundles registered through guicey api).protected voidextensionsInstalled(ExtensionsInstalledEvent event)Called after all installers install related extensions.protected voidextensionsResolved(ExtensionsResolvedEvent event)Called when all extensions detected (from classpath scan and guice modules).protected voidinjectorCreation(InjectorCreationEvent event)Called just before guice injector creation.protected voidinstallersResolved(InstallersResolvedEvent event)Called after all installers resolved (including installers found with classpath scan) and prepared for processing extensions.protected voidjerseyConfiguration(JerseyConfigurationEvent event)Jersey context starting.protected voidjerseyExtensionsInstalled(JerseyExtensionsInstalledEvent event)Called after allJerseyInstallerinstallers install related extensions and only when at least one extension was installed.protected voidlookupBundlesResolved(BundlesFromLookupResolvedEvent event)Called if at least one bundle recognized using bundles lookup.protected voidmanualExtensionsValidated(ManualExtensionsValidatedEvent event)Called when all manually registered extension classes are recognized by installers (validated).protected voidmodulesAnalyzed(ModulesAnalyzedEvent event)Called when guice bindings analyzed and all extensions detected.-
Methods inherited from class ru.vyarus.dropwizard.guice.module.lifecycle.UniqueGuiceyLifecycleListener
equals, hashCode
-
Methods inherited from class ru.vyarus.dropwizard.guice.module.lifecycle.GuiceyLifecycleAdapter
applicationShutdown, applicationStarted, applicationStopped, beforeInit, beforeRun, bundlesResolved, extensionsInstalledBy, initialized, jerseyExtensionsInstalledBy, onEvent
-
-
-
-
Method Detail
-
configurationHooksProcessed
protected void configurationHooksProcessed(ConfigurationHooksProcessedEvent event)
Description copied from class:GuiceyLifecycleAdapterAppeared just in time ofGuiceBundle.Builder.build()after manual builder configuration and allGuiceyConfigurationHookprocessing. Not called when no hooks were used.- Overrides:
configurationHooksProcessedin classGuiceyLifecycleAdapter- Parameters:
event- event object- See Also:
GuiceyLifecycle.ConfigurationHooksProcessed
-
dropwizardBundlesInitialized
protected void dropwizardBundlesInitialized(DropwizardBundlesInitializedEvent event)
Description copied from class:GuiceyLifecycleAdapterCalled after dropwizard bundles initialization (for dropwizard bundles registered through guicey api). Not called if no bundles were registered.- Overrides:
dropwizardBundlesInitializedin classGuiceyLifecycleAdapter- Parameters:
event- event object- See Also:
GuiceyLifecycle.DropwizardBundlesInitialized
-
lookupBundlesResolved
protected void lookupBundlesResolved(BundlesFromLookupResolvedEvent event)
Description copied from class:GuiceyLifecycleAdapterCalled if at least one bundle recognized using bundles lookup. Not called at if nothing found.- Overrides:
lookupBundlesResolvedin classGuiceyLifecycleAdapter- Parameters:
event- event object- See Also:
GuiceyLifecycle.BundlesFromLookupResolved
-
bundlesInitialized
protected void bundlesInitialized(BundlesInitializedEvent event)
Description copied from class:GuiceyLifecycleAdapterCalled after bundles initialization. Note that bundles could register other bundles and so resulted list of installed bundles could be bigger (than in resolution event).- Overrides:
bundlesInitializedin classGuiceyLifecycleAdapter- Parameters:
event- event object- See Also:
GuiceyLifecycle.BundlesInitialized
-
commandsResolved
protected void commandsResolved(CommandsResolvedEvent event)
Description copied from class:GuiceyLifecycleAdapterCalled if commands search is enabled (GuiceBundle.Builder.searchCommands()) and at least one command found. Not called otherwise.- Overrides:
commandsResolvedin classGuiceyLifecycleAdapter- Parameters:
event- event object- See Also:
GuiceyLifecycle.CommandsResolved
-
installersResolved
protected void installersResolved(InstallersResolvedEvent event)
Description copied from class:GuiceyLifecycleAdapterCalled after all installers resolved (including installers found with classpath scan) and prepared for processing extensions.- Overrides:
installersResolvedin classGuiceyLifecycleAdapter- Parameters:
event- event object- See Also:
GuiceyLifecycle.InstallersResolved
-
classpathExtensionsResolved
protected void classpathExtensionsResolved(ClasspathExtensionsResolvedEvent event)
Description copied from class:GuiceyLifecycleAdapterCalled when classes from classpath scan analyzed and all extensions detected. Called only if classpath scan is enabled and at least one extension detected.- Overrides:
classpathExtensionsResolvedin classGuiceyLifecycleAdapter- Parameters:
event- event object- See Also:
GuiceyLifecycle.ClasspathExtensionsResolved
-
bundlesStarted
protected void bundlesStarted(BundlesStartedEvent event)
Description copied from class:GuiceyLifecycleAdapterCalled after bundles start (run method call). Not called if no bundles were used at all.- Overrides:
bundlesStartedin classGuiceyLifecycleAdapter- Parameters:
event- event object- See Also:
GuiceyLifecycle.BundlesStarted
-
manualExtensionsValidated
protected void manualExtensionsValidated(ManualExtensionsValidatedEvent event)
Description copied from class:GuiceyLifecycleAdapterCalled when all manually registered extension classes are recognized by installers (validated). But only extensions, known to be enabled at that time are actually validated (this way it is possible to exclude extensions for non existing installers). Called only if at least one manual extension registered.- Overrides:
manualExtensionsValidatedin classGuiceyLifecycleAdapter- Parameters:
event- event object- See Also:
GuiceyLifecycle.ManualExtensionsValidated
-
modulesAnalyzed
protected void modulesAnalyzed(ModulesAnalyzedEvent event)
Description copied from class:GuiceyLifecycleAdapterCalled when guice bindings analyzed and all extensions detected. Called only if bindings analysis is enabled.- Overrides:
modulesAnalyzedin classGuiceyLifecycleAdapter- Parameters:
event- event object- See Also:
GuiceyLifecycle.ModulesAnalyzed
-
extensionsResolved
protected void extensionsResolved(ExtensionsResolvedEvent event)
Description copied from class:GuiceyLifecycleAdapterCalled when all extensions detected (from classpath scan and guice modules). Called even if no extensions configured to indicate configuration state.- Overrides:
extensionsResolvedin classGuiceyLifecycleAdapter- Parameters:
event- event object- See Also:
GuiceyLifecycle.ExtensionsResolved
-
injectorCreation
protected void injectorCreation(InjectorCreationEvent event)
Description copied from class:GuiceyLifecycleAdapterCalled just before guice injector creation. Called even if no modules were used at all (to indicate major lifecycle point).- Overrides:
injectorCreationin classGuiceyLifecycleAdapter- Parameters:
event- event object- See Also:
GuiceyLifecycle.InjectorCreation
-
extensionsInstalled
protected void extensionsInstalled(ExtensionsInstalledEvent event)
Description copied from class:GuiceyLifecycleAdapterCalled after all installers install related extensions. Not called when no extensions installed.- Overrides:
extensionsInstalledin classGuiceyLifecycleAdapter- Parameters:
event- event object- See Also:
GuiceyLifecycle.ExtensionsInstalled
-
applicationRun
protected void applicationRun(ApplicationRunEvent event)
Description copied from class:GuiceyLifecycleAdapterCalled afterGuiceBundle.run(io.dropwizard.core.Configuration, io.dropwizard.core.setup.Environment)when guicey context is started, extensions installed (but not hk extensions, because neither jersey nor jetty isn't start yet).- Overrides:
applicationRunin classGuiceyLifecycleAdapter- Parameters:
event- event object- See Also:
GuiceyLifecycle.ApplicationRun
-
jerseyConfiguration
protected void jerseyConfiguration(JerseyConfigurationEvent event)
Description copied from class:GuiceyLifecycleAdapterJersey context starting. At this point jersey and jetty is only initializing. Guicey jersey configuration is not yer performed. Since that point jerseyInjectionManageris accessible.- Overrides:
jerseyConfigurationin classGuiceyLifecycleAdapter- Parameters:
event- event object- See Also:
GuiceyLifecycle.JerseyConfiguration
-
jerseyExtensionsInstalled
protected void jerseyExtensionsInstalled(JerseyExtensionsInstalledEvent event)
Description copied from class:GuiceyLifecycleAdapterCalled after allJerseyInstallerinstallers install related extensions and only when at least one extension was installed.- Overrides:
jerseyExtensionsInstalledin classGuiceyLifecycleAdapter- Parameters:
event- event object- See Also:
GuiceyLifecycle.JerseyExtensionsInstalled
-
-