Print
Lifecycles

Avalon Lifecycle

The Avalon lifecycle follows a well defined order:

  1. Constructor: The Avalon IoC frameworks do not require you to do much in the constructor
  2. LogEnabled.enableLogging( Logger ): the Logger is passed to the component
  3. Contextualizable.context( Context ): the Context is passed to the component
  4. Serviceable.service( ServiceManager ): the ServiceManager is passed to the component that enables the lookup of the dependencies.
  5. Configurable.configure( Configuration ): the Configuration is passed to the component
  6. Initializable.initialize(): the component is initialized
  7. Startable.start(): the component is started

Loom multi-component management

While the lifecycle of a component is well defined as above, the order in which multi-component lifecycles are managed is specific to the kernel.

Loom goes through the whole lifecycle process to the start phase for each component before proceeding to the next one:

Component1 created.
Component1 LogEnabled.
Component1 Contextualized.
...
Component1 Started.

Component2 created.
Component2 LogEnabled.
Component2 Contextualized.
...
Component2 Started.
Powered by Atlassian Confluence