Page Contents
Home > @loopback/core > LifeCycleObserverRegistry
LifeCycleObserverRegistry class
A context-based registry for life cycle observers
Signature:
export declare class LifeCycleObserverRegistry implements LifeCycleObserver
Implements: LifeCycleObserver
Constructors
| Constructor | Modifiers | Description |
|---|---|---|
| (constructor)(context, observersView, options) | Constructs a new instance of the LifeCycleObserverRegistry class |
Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
| context | Context | ||
| observersView | ContextView<LifeCycleObserver> | ||
| options | LifeCycleObserverOptions |
Methods
| Method | Modifiers | Description |
|---|---|---|
| getObserverGroup(binding) | Get the group for a given life cycle observer binding | |
| getObserverGroupsByOrder() | Get observer groups ordered by the group | |
| init() | Notify all life cycle observers by group of init |
|
| invokeObserver(observer, event) | Invoke an observer for the given event | |
| notifyGroups(events, groups, reverse) | Emit events to the observer groups | |
| notifyObservers(observers, bindings, event) | Notify an observer group of the given event | |
| setOrderedGroups(groups) | ||
| sortObserverBindingsByGroup(bindings) | Sort the life cycle observer bindings so that we can start/stop them in the right order. By default, we can start other observers before servers and stop them in the reverse order | |
| start() | Notify all life cycle observers by group of start |
|
| stop() | Notify all life cycle observers by group of stop |