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)](/doc/en/lb4/apidocs.core.lifecycleobserverregistry._constructor_.html) Constructs a new instance of the `LifeCycleObserverRegistry` class

Properties

Property Modifiers Type Description
[context](/doc/en/lb4/apidocs.core.lifecycleobserverregistry.context.html) `protected` `readonly` [Context](/doc/en/lb4/apidocs.context.context.html)
[observersView](/doc/en/lb4/apidocs.core.lifecycleobserverregistry.observersview.html) `protected` `readonly` [ContextView](/doc/en/lb4/apidocs.context.contextview.html)<[LifeCycleObserver](/doc/en/lb4/apidocs.core.lifecycleobserver.html)>
[options](/doc/en/lb4/apidocs.core.lifecycleobserverregistry.options.html) `protected` `readonly` [LifeCycleObserverOptions](/doc/en/lb4/apidocs.core.lifecycleobserveroptions.html)

Methods

Method Modifiers Description
[getObserverGroup(binding)](/doc/en/lb4/apidocs.core.lifecycleobserverregistry.getobservergroup.html) `protected` Get the group for a given life cycle observer binding
[getObserverGroupsByOrder()](/doc/en/lb4/apidocs.core.lifecycleobserverregistry.getobservergroupsbyorder.html) Get observer groups ordered by the group
[init()](/doc/en/lb4/apidocs.core.lifecycleobserverregistry.init.html) Notify all life cycle observers by group of `init`
[invokeObserver(observer, event)](/doc/en/lb4/apidocs.core.lifecycleobserverregistry.invokeobserver.html) `protected` Invoke an observer for the given event
[notifyGroups(events, groups, reverse)](/doc/en/lb4/apidocs.core.lifecycleobserverregistry.notifygroups.html) `protected` Emit events to the observer groups
[notifyObservers(observers, bindings, event)](/doc/en/lb4/apidocs.core.lifecycleobserverregistry.notifyobservers.html) `protected` Notify an observer group of the given event
[setOrderedGroups(groups)](/doc/en/lb4/apidocs.core.lifecycleobserverregistry.setorderedgroups.html)
[sortObserverBindingsByGroup(bindings)](/doc/en/lb4/apidocs.core.lifecycleobserverregistry.sortobserverbindingsbygroup.html) `protected` 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()](/doc/en/lb4/apidocs.core.lifecycleobserverregistry.start.html) Notify all life cycle observers by group of `start`
[stop()](/doc/en/lb4/apidocs.core.lifecycleobserverregistry.stop.html) Notify all life cycle observers by group of `stop`