Extension modules for LoopBack often contribute artifacts such as servers,datasources, and connectors to the application. They typically provide acomponent to bind such artifacts to the context together. Being able to listenon life cycle events is important for extension modules to collaborate with theapplication.
A life cycle observer class optionally implements and stop
methods tobe invoked upon start
and stop
events emitted by an application’s life cyclerespectively.
Register a life cycle observer
A life cycle observer can be registered by calling lifeCycleObserver()
of theapplication. It binds the observer to the application context with a specialtag - CoreTags.LIFE_CYCLE_OBSERVER
.