Class GuiceyLifecycleAdapter
java.lang.Object
ru.vyarus.dropwizard.guice.module.lifecycle.GuiceyLifecycleAdapter
- All Implemented Interfaces:
GuiceyLifecycleListener
- Direct Known Subclasses:
ApplicationShutdownListenerAdapter,ApplicationStartupListenerAdapter,ConfigurationDiagnostic,GuiceAopDiagnostic,GuiceyStartupListenerAdapter,UniqueGuiceyLifecycleListener
Adapter for
GuiceyLifecycleListener. Useful when you need to listen for multiple events: extend adapter
and override just required methods.- Since:
- 18.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 on application shutdown start.protected voidCalled after complete dropwizard startup.protected voidCalled after complete application configuration (Application.run(io.dropwizard.core.Configuration, io.dropwizard.core.setup.Environment)called), but before lifecycle startup (before managed objects run).protected voidCalled after application shutdown.protected voidbeforeInit(BeforeInitEvent event) Special meta event, called before allGuiceBundleconfiguration phase logic.protected voidbeforeRun(BeforeRunEvent event) Meta event.protected voidCalled after bundles initialization.protected voidCalled when all bundles are resolved (after dw recognition and lookup).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 installer installed all related extensions and only for installers actually performed installations (extensions list never empty).protected voidCalled when all extensions detected (from classpath scan and guice modules).protected voidinitialized(InitializedEvent event) Called after guicey initialization (includes bundles lookup and initialization, installers and extensions resolution).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 whenJerseyInstallerinstaller installed all related extensions and only for installers actually performed installations (extensions list never empty).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.voidonEvent(GuiceyLifecycleEvent event) Called with specific lifecycle event.
-
Constructor Details
-
GuiceyLifecycleAdapter
public GuiceyLifecycleAdapter()
-
-
Method Details
-
onEvent
Description copied from interface:GuiceyLifecycleListenerCalled with specific lifecycle event. Event object may contain event specific objects. Event always contain main objects, available at this point (like configuration, environment, injector etc).- Specified by:
onEventin interfaceGuiceyLifecycleListener- Parameters:
event- event instance- See Also:
-
configurationHooksProcessed
Appeared just in time ofGuiceBundle.Builder.build()after manual builder configuration and allGuiceyConfigurationHookprocessing. Not called when no hooks were used.- Parameters:
event- event object- See Also:
-
beforeInit
Special meta event, called before allGuiceBundleconfiguration phase logic.Bootstrapobject is available, but dropwizard bundles (registered through guicey) are not yet registered (note thatGuiceBundleis not yet added to bootstrap also because dropwizard calls bundle initialization before registering bundle (and so all dropwizard bundles, registered by guicey, will run beforeGuiceBundlerun).- Parameters:
event- event object- See Also:
-
dropwizardBundlesInitialized
Called after dropwizard bundles initialization (for dropwizard bundles registered through guicey api). Not called if no bundles were registered.- Parameters:
event- event object- See Also:
-
lookupBundlesResolved
Called if at least one bundle recognized using bundles lookup. Not called at if nothing found.- Parameters:
event- event object- See Also:
-
bundlesResolved
Called when all bundles are resolved (after dw recognition and lookup). Called even if no bundles registered.- Parameters:
event- event object- See Also:
-
bundlesInitialized
Called after bundles initialization. Note that bundles could register other bundles and so resulted list of installed bundles could be bigger (than in resolution event).- Parameters:
event- event object- See Also:
-
commandsResolved
Called if commands search is enabled (GuiceBundle.Builder.searchCommands()) and at least one command found. Not called otherwise.- Parameters:
event- event object- See Also:
-
installersResolved
Called after all installers resolved (including installers found with classpath scan) and prepared for processing extensions.- Parameters:
event- event object- See Also:
-
classpathExtensionsResolved
Called when classes from classpath scan analyzed and all extensions detected. Called only if classpath scan is enabled and at least one extension detected.- Parameters:
event- event object- See Also:
-
initialized
Called after guicey initialization (includes bundles lookup and initialization, installers and extensions resolution). Pure marker event, indicating guicey work finished under dropwizard configuration phase.- Parameters:
event- event object- See Also:
-
beforeRun
Meta event. Called just before guice bundle processing in run phase.- Parameters:
event- event object- See Also:
-
bundlesStarted
Called after bundles start (run method call). Not called if no bundles were used at all.- Parameters:
event- event object- See Also:
-
manualExtensionsValidated
Called 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.- Parameters:
event- event object- See Also:
-
modulesAnalyzed
Called when guice bindings analyzed and all extensions detected. Called only if bindings analysis is enabled.- Parameters:
event- event object- See Also:
-
extensionsResolved
Called when all extensions detected (from classpath scan and guice modules). Called even if no extensions configured to indicate configuration state.- Parameters:
event- event object- See Also:
-
injectorCreation
Called just before guice injector creation. Called even if no modules were used at all (to indicate major lifecycle point).- Parameters:
event- event object- See Also:
-
extensionsInstalledBy
Called when installer installed all related extensions and only for installers actually performed installations (extensions list never empty).- Parameters:
event- event object- See Also:
-
extensionsInstalled
Called after all installers install related extensions. Not called when no extensions installed.- Parameters:
event- event object- See Also:
-
applicationRun
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).- Parameters:
event- event object- See Also:
-
applicationStarting
Called after complete application configuration (Application.run(io.dropwizard.core.Configuration, io.dropwizard.core.setup.Environment)called), but before lifecycle startup (before managed objects run). Actually the same as jetty lifecycle started event (LifeCycle.Listener.lifeCycleStarting(org.eclipse.jetty.util.component.LifeCycle).- Parameters:
event- event object- See Also:
-
jerseyConfiguration
Jersey context starting. At this point jersey and jetty is only initializing. Guicey jersey configuration is not yer performed. Since that point jerseyInjectionManageris accessible.- Parameters:
event- event object- See Also:
-
jerseyExtensionsInstalledBy
Called whenJerseyInstallerinstaller installed all related extensions and only for installers actually performed installations (extensions list never empty).- Parameters:
event- event object- See Also:
-
jerseyExtensionsInstalled
Called after allJerseyInstallerinstallers install related extensions and only when at least one extension was installed.- Parameters:
event- event object- See Also:
-
applicationStarted
Called after complete dropwizard startup. Actually the same as jetty lifecycle started event (LifeCycle.Listener.lifeCycleStarted(org.eclipse.jetty.util.component.LifeCycle)), which is called after complete jetty startup.- Parameters:
event- event object- See Also:
-
applicationShutdown
Called on application shutdown start. Triggered by jetty lifecycle stopping event (LifeCycle.Listener.lifeCycleStopping(org.eclipse.jetty.util.component.LifeCycle)).- Parameters:
event- event object- See Also:
-
applicationStopped
Called after application shutdown. Triggered by jetty lifecycle stopping event (LifeCycle.Listener.lifeCycleStopped(org.eclipse.jetty.util.component.LifeCycle)).- Parameters:
event- event object- See Also:
-