The Context within Content Manager is a way to route messages around
components. The ContextHandler acts as the hub, following the singleton pattern.
Objects fire ContextEvents, targetted at a specific ContextType. Other objects
listen to the ContextHandler, on specific ContextTypes. This means, for example,
that any object can be set up as a listener on the SHUTDOWN context, which
will only ever recieve one message when a shutdown is initiated. Therefore
disparate components can all know when the application is about to shutdown
and tidy up whatever resources they need to.
|