public enum GuiceyLifecycle extends java.lang.Enum<GuiceyLifecycle>
GuiceyLifecycleListener:
GuiceyLifecycleEvent.getType().
Events specified in execution order.
| Enum Constant and Description |
|---|
ApplicationRun
Called after
GuiceBundle.run(io.dropwizard.Configuration, io.dropwizard.setup.Environment)
when guicey context is started, extensions installed (but not hk extensions, because neither jersey nor jetty
is't start yet). |
ApplicationStarted
Called after complete dropwizard startup.
|
BeforeRun
Special meta event, called before all
GuiceBundle run phase logic
(when configuration and environment are already available). |
BundlesFromLookupResolved
Called if at least one bundle recognized using bundles lookup.
|
BundlesInitialized
Called after bundles processing.
|
BundlesResolved
Called after
GuiceyBundleLookup mechanisms when all top-level
bundles are resolved. |
BundlesStarted
Called after bundles started (run method call).
|
ClasspathExtensionsResolved
Called when classes from classpath scan analyzed and all extensions detected.
|
CommandsResolved
Called if commands search is enabled (
GuiceBundle.Builder.searchCommands())
and at least one command found (and installed). |
ConfigurationHooksProcessed
Called after all registered
GuiceyConfigurationHook processing. |
DropwizardBundlesInitialized
Called after dropwizard bundles initialization (for dropwizard bundles registered through guicey api).
|
ExtensionsInstalled
Called after all installers install related extensions.
|
ExtensionsInstalledBy
Called when installer installed all related extensions and only for installers actually performed
installations (extensions list never empty).
|
ExtensionsResolved
Called when all extensions detected (from classpath scan and guice modules).
|
Initialized
Called after guicey initialization (includes bundles lookup and initialization,
installers and extensions resolution).
|
InjectorCreation
Called just before guice injector creation.
|
InstallersResolved
Called when installers resolved (from classpath scan, if enabled) and initialized.
|
JerseyConfiguration
Jersey context starting.
|
JerseyExtensionsInstalled
Called after all
JerseyInstaller installers install
related extensions and only when at least one extension was installed. |
JerseyExtensionsInstalledBy
Called when
JerseyInstaller installer installed all
related extensions and only for installers actually performed installations (extensions list never empty). |
ManualExtensionsValidated
Called when all manually registered extension classes are recognized by installers (validated).
|
ModulesAnalyzed
Called after guice modules analysis and repackaging.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Class<? extends GuiceyLifecycleEvent> |
getType() |
static GuiceyLifecycle |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static GuiceyLifecycle[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final GuiceyLifecycle ConfigurationHooksProcessed
GuiceyConfigurationHook processing.
Provides all instances of executed hooks. Not called if no hooks used.public static final GuiceyLifecycle DropwizardBundlesInitialized
public static final GuiceyLifecycle BundlesFromLookupResolved
public static final GuiceyLifecycle BundlesResolved
GuiceyBundleLookup mechanisms 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.public static final GuiceyLifecycle BundlesInitialized
public static final GuiceyLifecycle CommandsResolved
GuiceBundle.Builder.searchCommands())
and at least one command found (and installed). Not called otherwise.public static final GuiceyLifecycle InstallersResolved
public static final GuiceyLifecycle ManualExtensionsValidated
public static final GuiceyLifecycle ClasspathExtensionsResolved
public static final GuiceyLifecycle Initialized
Note: dropwizard bundles, registered after GuiceBundle will be initialized
after this point.
public static final GuiceyLifecycle BeforeRun
GuiceBundle run 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).public static final GuiceyLifecycle BundlesStarted
public static final GuiceyLifecycle ModulesAnalyzed
public static final GuiceyLifecycle ExtensionsResolved
public static final GuiceyLifecycle InjectorCreation
public static final GuiceyLifecycle ExtensionsInstalledBy
NOTE: JerseyInstaller installers 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.
public static final GuiceyLifecycle ExtensionsInstalled
Extension instance could be obtained manually from injector. Injector is available because it's already constructed.
public static final GuiceyLifecycle ApplicationRun
GuiceBundle.run(io.dropwizard.Configuration, io.dropwizard.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.Configuration, io.dropwizard.setup.Environment). Ideal point
for jersey and jetty listeners installation (with shortcut event methods).
public static final GuiceyLifecycle JerseyConfiguration
InjectionManager is accessible.public static final GuiceyLifecycle JerseyExtensionsInstalledBy
JerseyInstaller installer 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.
public static final GuiceyLifecycle JerseyExtensionsInstalled
JerseyInstaller installers 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).
public static final GuiceyLifecycle ApplicationStarted
AbstractLifeCycle.AbstractLifeCycleListener.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 (GuiceyAppRule) which does not
start the web part.
public static GuiceyLifecycle[] values()
for (GuiceyLifecycle c : GuiceyLifecycle.values()) System.out.println(c);
public static GuiceyLifecycle valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic java.lang.Class<? extends GuiceyLifecycleEvent> getType()