MiddlewareRegistry
This registry allows you to keep track of multiple middleware and multiple contexts. It defines a single level hierarchy where there is the parent context, and optional children contexts.
You can define a parent MiddlewareContext for the registry. Children middleware will have access to the parent context as long as they are registered and the parent context is attached. You can also define MiddlewareContextFactory which is used to construct context from the parent MiddlewareContext. The child context can not have a lifecycle outside of the parent context; in other words, when the parent context is detached, all the children are detached. You control the lifecycle of the children context with the register, unregister functions.
Properties
Functions
Retrieves a single middleware instance of a given class type.
Retrieves all middleware instances of a given class type
Launches a suspending block when the registry is attached
Observes middleware instances of a given class type.
Attaches all registered middleware instances when the registry is attached
Detaches all registered middleware instances when the registry is detached
Registers a middleware instance
Registers a middleware instance with a context factory
Executes a suspending block whenever the registry is attached
Unregisters a middleware instance
Unregisters all middleware instances.