Class GuiceyLifecycleAdapter
- java.lang.Object
-
- ru.vyarus.dropwizard.guice.module.lifecycle.GuiceyLifecycleAdapter
-
- All Implemented Interfaces:
GuiceyLifecycleListener
- Direct Known Subclasses:
ApplicationStartupListenerAdapter,ConfigurationDiagnostic,GuiceAopDiagnostic,GuiceyStartupListenerAdapter,UniqueGuiceyLifecycleListener
public class GuiceyLifecycleAdapter extends java.lang.Object implements GuiceyLifecycleListener
Adapter forGuiceyLifecycleListener. Useful when you need to listen for multiple events: extend adapter and override just required methods.- Since:
- 18.04.2018
-
-
Constructor Summary
Constructors Constructor Description GuiceyLifecycleAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidapplicationRun(ApplicationRunEvent event)Called afterGuiceBundle.run(io.dropwizard.Configuration, io.dropwizard.setup.Environment)when guicey context is started, extensions installed (but not hk extensions, because neither jersey nor jetty isn't start yet).protected voidapplicationShutdown(ApplicationShotdownEvent event)Called on application shutdown start.protected voidapplicationStarted(ApplicationStartedEvent event)Called after complete dropwizard startup.protected voidapplicationStopped(ApplicationStoppedEvent event)Called after application shutdown.protected voidbeforeRun(BeforeRunEvent event)Meta event.protected voidbundlesInitialized(BundlesInitializedEvent event)Called after bundles initialization.protected voidbundlesResolved(BundlesResolvedEvent event)Called when all bundles are resolved (after dw recognition and lookup).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 voidextensionsInstalledBy(ExtensionsInstalledByEvent event)Called when installer installed all related extensions and only for installers actually performed installations (extensions list never empty).protected voidextensionsResolved(ExtensionsResolvedEvent event)Called 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 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 voidjerseyExtensionsInstalledBy(JerseyExtensionsInstalledByEvent event)Called whenJerseyInstallerinstaller installed all related extensions and only for installers actually performed installations (extensions list never empty).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.voidonEvent(GuiceyLifecycleEvent event)Called with specific lifecycle event.
-
-
-
Method Detail
-
onEvent
public void onEvent(GuiceyLifecycleEvent event)
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:
for possible event types
-
configurationHooksProcessed
protected void configurationHooksProcessed(ConfigurationHooksProcessedEvent event)
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:
GuiceyLifecycle.ConfigurationHooksProcessed
-
dropwizardBundlesInitialized
protected void dropwizardBundlesInitialized(DropwizardBundlesInitializedEvent event)
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:
GuiceyLifecycle.DropwizardBundlesInitialized
-
lookupBundlesResolved
protected void lookupBundlesResolved(BundlesFromLookupResolvedEvent event)
Called if at least one bundle recognized using bundles lookup. Not called at if nothing found.- Parameters:
event- event object- See Also:
GuiceyLifecycle.BundlesFromLookupResolved
-
bundlesResolved
protected void bundlesResolved(BundlesResolvedEvent event)
Called when all bundles are resolved (after dw recognition and lookup). Called even if no bundles registered.- Parameters:
event- event object- See Also:
GuiceyLifecycle.BundlesResolved
-
bundlesInitialized
protected void bundlesInitialized(BundlesInitializedEvent event)
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:
GuiceyLifecycle.BundlesInitialized
-
commandsResolved
protected void commandsResolved(CommandsResolvedEvent event)
Called if commands search is enabled (GuiceBundle.Builder.searchCommands()) and at least one command found. Not called otherwise.- Parameters:
event- event object- See Also:
GuiceyLifecycle.CommandsResolved
-
installersResolved
protected void installersResolved(InstallersResolvedEvent event)
Called after all installers resolved (including installers found with classpath scan) and prepared for processing extensions.- Parameters:
event- event object- See Also:
GuiceyLifecycle.InstallersResolved
-
manualExtensionsValidated
protected void manualExtensionsValidated(ManualExtensionsValidatedEvent event)
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:
GuiceyLifecycle.ManualExtensionsValidated
-
classpathExtensionsResolved
protected void classpathExtensionsResolved(ClasspathExtensionsResolvedEvent event)
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:
GuiceyLifecycle.ClasspathExtensionsResolved
-
initialized
protected void initialized(InitializedEvent event)
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:
GuiceyLifecycle.Initialized
-
beforeRun
protected void beforeRun(BeforeRunEvent event)
Meta event. Called just before guice bundle processing in run phase.- Parameters:
event- event object- See Also:
GuiceyLifecycle.BeforeRun
-
bundlesStarted
protected void bundlesStarted(BundlesStartedEvent event)
Called after bundles start (run method call). Not called if no bundles were used at all.- Parameters:
event- event object- See Also:
GuiceyLifecycle.BundlesStarted
-
modulesAnalyzed
protected void modulesAnalyzed(ModulesAnalyzedEvent event)
Called when guice bindings analyzed and all extensions detected. Called only if bindings analysis is enabled.- Parameters:
event- event object- See Also:
GuiceyLifecycle.ModulesAnalyzed
-
extensionsResolved
protected void extensionsResolved(ExtensionsResolvedEvent event)
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:
GuiceyLifecycle.ExtensionsResolved
-
injectorCreation
protected void injectorCreation(InjectorCreationEvent event)
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:
GuiceyLifecycle.InjectorCreation
-
extensionsInstalledBy
protected void extensionsInstalledBy(ExtensionsInstalledByEvent event)
Called when installer installed all related extensions and only for installers actually performed installations (extensions list never empty).- Parameters:
event- event object- See Also:
GuiceyLifecycle.ExtensionsInstalledBy
-
extensionsInstalled
protected void extensionsInstalled(ExtensionsInstalledEvent event)
Called after all installers install related extensions. Not called when no extensions installed.- Parameters:
event- event object- See Also:
GuiceyLifecycle.ExtensionsInstalled
-
applicationRun
protected void applicationRun(ApplicationRunEvent event)
Called afterGuiceBundle.run(io.dropwizard.Configuration, io.dropwizard.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:
GuiceyLifecycle.ApplicationRun
-
jerseyConfiguration
protected void jerseyConfiguration(JerseyConfigurationEvent event)
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:
GuiceyLifecycle.JerseyConfiguration
-
jerseyExtensionsInstalledBy
protected void jerseyExtensionsInstalledBy(JerseyExtensionsInstalledByEvent event)
Called whenJerseyInstallerinstaller installed all related extensions and only for installers actually performed installations (extensions list never empty).- Parameters:
event- event object- See Also:
GuiceyLifecycle.JerseyExtensionsInstalledBy
-
jerseyExtensionsInstalled
protected void jerseyExtensionsInstalled(JerseyExtensionsInstalledEvent event)
Called after allJerseyInstallerinstallers install related extensions and only when at least one extension was installed.- Parameters:
event- event object- See Also:
GuiceyLifecycle.JerseyExtensionsInstalled
-
applicationStarted
protected void applicationStarted(ApplicationStartedEvent event)
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:
GuiceyLifecycle.ApplicationStarted
-
applicationShutdown
protected void applicationShutdown(ApplicationShotdownEvent event)
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:
GuiceyLifecycle.ApplicationShutdown
-
applicationStopped
protected void applicationStopped(ApplicationStoppedEvent event)
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:
GuiceyLifecycle.ApplicationStopped
-
-