Generalized notification mechanism
Notifications are asynchronous and contain an user-defined identifier. For reliable delivery to a INotifiable receiver, the receiver can enqueue the notification into a queue. The queue entry is supplied by the INotifier and contains the user's identifier and a pointer to the INotifier. The interface is INotifiable::notify(Notification*). The INotifier is informed about the delivery through a callback INotifier::delivered(Notification*). The INotifier can check if its queue entry is still enqued with Notification::isPending() and can revoke its entry from the queue by INotifiable::denotify(Notification*). The latter is important when capabilities are revoked to delete objects.
The INotifiable may use process notifications immediately without enqeuing. They may use a ring buffer to forward notification identifiers more efficiently and these are acknowledged as delivered immediately. When the ring buffer is full, pending notifications have to be enqueued to guarantee delivery.
Currently, only the Portals use the notification mechanism. The portal stores the user's identifier outside of the notification entry. However, this is unpleasant when one object has to manage multiple notifications and keep them apart.