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
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 -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCalled 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 voidCalled after bundles initialization.protected voidCalled after bundles start (run method call).protected voidCalled when classes from classpath scan analyzed and all extensions detected.protected voidCalled if commands search is enabled (GuiceBundle.Builder.searchCommands()) and at least one command found.protected voidAppeared just in time ofGuiceBundle.Builder.build()after manual builder configuration and allGuiceyConfigurationHookprocessing.protected voidCalled after dropwizard bundles initialization (for dropwizard bundles registered through guicey api).protected voidCalled after all installers install related extensions.protected voidCalled when all extensions detected (from classpath scan and guice modules).protected voidCalled just before guice injector creation.protected voidCalled after all installers resolved (including installers found with classpath scan) and prepared for processing extensions.protected voidJersey context starting.protected voidCalled after allJerseyInstallerinstallers install related extensions and only when at least one extension was installed.protected voidCalled if at least one bundle recognized using bundles lookup.protected voidCalled when all manually registered extension classes are recognized by installers (validated).protected voidCalled when guice bindings analyzed and all extensions detected.Methods inherited from class ru.vyarus.dropwizard.guice.module.lifecycle.UniqueGuiceyLifecycleListener
equals, hashCodeMethods inherited from class ru.vyarus.dropwizard.guice.module.lifecycle.GuiceyLifecycleAdapter
applicationShutdown, applicationStarted, applicationStarting, applicationStopped, beforeInit, beforeRun, bundlesResolved, extensionsInstalledBy, initialized, jerseyExtensionsInstalledBy, onEvent
-
Constructor Details
-
LifecycleDiagnostic
public LifecycleDiagnostic(boolean showDetails) Create lifecycle diagnostic.- Parameters:
showDetails- true to show all details (verbose)
-
-
Method Details
-
configurationHooksProcessed
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:
-
dropwizardBundlesInitialized
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:
-
lookupBundlesResolved
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:
-
bundlesInitialized
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:
-
commandsResolved
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:
-
installersResolved
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:
-
classpathExtensionsResolved
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:
-
bundlesStarted
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:
-
manualExtensionsValidated
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:
-
modulesAnalyzed
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:
-
extensionsResolved
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:
-
injectorCreation
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:
-
extensionsInstalled
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:
-
applicationRun
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:
-
jerseyConfiguration
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:
-
jerseyExtensionsInstalled
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:
-