Enum Class GuiceyLifecycle
- All Implemented Interfaces:
Serializable,Comparable<GuiceyLifecycle>,Constable
GuiceyLifecycleListener:
GuiceyLifecycleEvent.getType().
Events specified in execution order.
- Since:
- 19.04.2018
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionCalled 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 is't start yet).Called on application shutdown start.Called after complete dropwizard startup.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).Called after application shutdown.Special meta event, called before allGuiceBundleconfiguration phase logic.Special meta event, called before allGuiceBundlerun phase logic (when configuration and environment are already available).Called if at least one bundle recognized using bundles lookup.Called after bundles processing.Called afterGuiceyBundleLookupmechanisms when all top-level bundles are resolved.Called after bundles started (run method call).Called when classes from classpath scan analyzed and all extensions detected.Called if commands search is enabled (GuiceBundle.Builder.searchCommands()) and at least one command found (and installed).Called after all registeredGuiceyConfigurationHookprocessing.Called after dropwizard bundles initialization (for dropwizard bundles registered through guicey api).Called after all installers install related extensions.Called when installer installed all related extensions and only for installers actually performed installations (extensions list never empty).Called when all extensions detected (from classpath scan and guice modules).Called after guicey initialization (includes bundles lookup and initialization, installers and extensions resolution).Called just before guice injector creation.Called when installers resolved (from classpath scan, if enabled) and initialized.Jersey context starting.Called after allJerseyInstallerinstallers install related extensions and only when at least one extension was installed.Called whenJerseyInstallerinstaller installed all related extensions and only for installers actually performed installations (extensions list never empty).Called when all manually registered extension classes are recognized by installers (validated).Called after guice modules analysis and repackaging. -
Method Summary
Modifier and TypeMethodDescriptionClass<? extends GuiceyLifecycleEvent>getType()static GuiceyLifecycleReturns the enum constant of this class with the specified name.static GuiceyLifecycle[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ConfigurationHooksProcessed
Called after all registeredGuiceyConfigurationHookprocessing. Provides all instances of executed hooks. Not called if no hooks used. -
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). -
DropwizardBundlesInitialized
Called after dropwizard bundles initialization (for dropwizard bundles registered through guicey api). Not called if no bundles were registered. -
BundlesFromLookupResolved
Called if at least one bundle recognized using bundles lookup. Provides list of recognized bundles (note: some of these bundles could be disabled and not used further). -
BundlesResolved
Called afterGuiceyBundleLookupmechanisms when all top-level bundles are resolved. Provides a list of all enabled and list of disabled bundles. Called even if no bundles registered to indicate configuration state. -
BundlesInitialized
Called after bundles processing. Note that bundles could register other bundles and so resulted list of installed bundles could be bigger (than in resolution event). Provides a list of all used and all disabled bundles. Not called even if no bundles were used at all (no initialization - no event). -
CommandsResolved
Called if commands search is enabled (GuiceBundle.Builder.searchCommands()) and at least one command found (and installed). Not called otherwise. -
InstallersResolved
Called when installers resolved (from classpath scan, if enabled) and initialized. Provides list of all enabled and list of all disabled installers (which will be used for extensions recognition and installation). Called even if no installers are resolved to indicate configuration state. -
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. -
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.Note: dropwizard bundles, registered after
GuiceBundlewill be initialized after this point. -
BeforeRun
Special meta event, called before allGuiceBundlerun phase logic (when configuration and environment are already available). Could be used to print some diagnostic info before guicey initialization (for example, available configuration bindings to debug guice injector creation failure due to missed bindings). -
BundlesStarted
Called after bundles started (run method call). Not called if no bundles were used at all. Note that dropwizard bundles are not yet started because dropwizard will call it's run method after guice bundle processing. -
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.Performed in run phase because extensions could be registered in both phases.
-
ModulesAnalyzed
Called after guice modules analysis and repackaging. Reveals all detected extensions and removed bindings info. Called only if bindings analysis is enabled. -
ExtensionsResolved
Called when all extensions detected (from classpath scan and guice modules). Provides list of all enabled and list of disabled extension types (instances are not available yet). Called even if no extensions configured to indicate configuration state. -
InjectorCreation
Called just before guice injector creation. Provides all configured modules (main and override) and all disabled modules. Note that provided configured module instances were already processed (during bindings analysis) and so it makes no sense to modify them (only overriding modules will be actually used because they are not used during bindings analysis). Called even when no modules registered to indicate configuration state. -
ExtensionsInstalledBy
Called when installer installed all related extensions and only for installers actually performed installations (extensions list never empty). Provides installer and installed extensions types.NOTE:
JerseyInstallerinstallers will not be notified here, even if they participate in installation it is considered as incomplete at that point.Extension instance could be obtained manually from injector. Injector is available because it's already constructed.
-
ExtensionsInstalled
Called after all installers install related extensions. Provides list of all used (enabled) extensions. Not called when no extensions installed.Extension instance could be obtained manually from injector. Injector is available because it's already constructed.
-
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 is't start yet).At this point injection to registered commands is performed (this may be important if custom command run application instead of "server"). Injector itself is completely initialized - all singletons started.
This point is before
Application.run(io.dropwizard.core.Configuration, io.dropwizard.core.setup.Environment). Ideal point for jersey and jetty listeners installation (with shortcut event methods). To run after application run useApplicationStarting. -
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).May be used as for additional services startup (after all initializations), executed before "started" point, often used for reporting. As an example, sub rest use this event to run jersey context after initialization. This event also will be fired in guicey tests (
TestGuiceyAppwhich does not start the web part).NOTE: jersey context is not started yet!
-
JerseyConfiguration
Jersey context starting. At this point jersey is starting and jetty is only initializing. Since that point jerseyInjectionManageris accessible. -
JerseyExtensionsInstalledBy
Called whenJerseyInstallerinstaller installed all related extensions and only for installers actually performed installations (extensions list never empty). Provides installer and installed extensions types.At this point jersey is not completely started and so jersey managed extensions (
JerseyManaged) couldn't be obtained yet (even though you have access to root service locator). But extensions managed by guice could be obtained from guice context. -
JerseyExtensionsInstalled
Called after allJerseyInstallerinstallers install related extensions and only when at least one extension was installed. Provides list of all used (enabled) extensions.At this point jersey is not completely started and so jersey managed extensions (
JerseyManaged) couldn't be obtained yet (even though you have access to root service locator). But extensions managed by guice could be obtained from guice context.To listen jersey lifecycle further use jersey events (like in
LifecycleDiagnostic). -
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.May be used as assured "started" point (after all initializations). For example, to report something. This event also will be fired in guicey tests (
TestGuiceyApp) which does not start the web part). -
ApplicationShutdown
Called on application shutdown start. Triggered by jetty lifecycle stopping event (LifeCycle.Listener.lifeCycleStopping(org.eclipse.jetty.util.component.LifeCycle)).May be used to perform some shutdown logic.
-
ApplicationStopped
Called after application shutdown. Triggered by jetty lifecycle stopping event (LifeCycle.Listener.lifeCycleStopped(org.eclipse.jetty.util.component.LifeCycle)).Supposed to be used to cleanup some resources after complete shutdown (very specific cases).
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getType
- Returns:
- type of related event
-