An object registers a hook into a component manager event via a HooksRegistration object.
A single object may register for multiple events through a vector of EventType. Hooks
does not retain the callback. The hook is lazily removed when the callback object loses
strong references.
The component manager calls out to objects that implement the Hook trait on registered
component manager events. Hooks block the flow of a task, and can mutate, decorate and replace
capabilities. This permits Hook to serve as a point of extensibility for the component
manager.
IMPORTANT: Hooks must not block on completion of an Action since Hooks are often called while
executing an Action. Waiting on an Action in a Hook could cause a deadlock.
IMPORTANT: Hooks should avoid causing event dispatch because we do not guarantee serialization
between Hooks. Therefore the order a receiver see events in may be unexpected.