An environment loader has a lifecycle that starts each time the load() method is invoked. Each lifecycle ends when the method returns. Your implementation can use lifecycle hook methods to tap into key events in the environment loader service.
Respond to events in the lifecycle of the loader by implementing one or more of the lifecycle hook interfaces presented. The hooks give you the opportunity to act on the instance at the appropriate moment.
Each interface defines the prototype for a single hook method, whose name is the interface name starting in lowercase. For example, the OnBeforeLoad interface has a hook method named onBeforeLoad().
You don't have to implement all (or any) of the lifecycle hooks, just the ones you need.
Interface
Lifecycle event
OnBeforeLoad
Before start the environment sources load
OnBeforeSourceLoad
Before a source starts to load the properties
OnBeforeSourceAdd
Before a source properties are added to the environment
OnAfterSourceAdd
After a source properties are added to the environment
Lifecycle Hooks
An environment loader has a lifecycle that starts each time the load() method is invoked. Each lifecycle ends when the method returns. Your implementation can use lifecycle hook methods to tap into key events in the environment loader service.
Respond to events in the lifecycle of the loader by implementing one or more of the lifecycle hook interfaces presented. The hooks give you the opportunity to act on the instance at the appropriate moment.
Each interface defines the prototype for a single hook method, whose name is the interface name starting in lowercase. For example, the OnBeforeLoad interface has a hook method named onBeforeLoad().
You don't have to implement all (or any) of the lifecycle hooks, just the ones you need.
OnBeforeLoad
OnBeforeSourceLoad
OnBeforeSourceAdd
OnAfterSourceAdd
OnAfterSourceComplete
OnAfterSourceError
OnAfterComplete
OnAfterLoad
OnAfterError
Use cases
Below are examples of the expected behavior with the default loader implementation.
Table of Contents
Add logs to the loader
Resolve when setting a subset of properties
Stop loading after load error