Fork me on GitHub

Extensions

You can use extensions to add functionality to the event broker. Examples are the DistributedEventBroker (sending events over process boundaries) and MappingEventBroker (mapping event arguments to other types) extensions. Extensions can also be used to implement logging or take control of exception handling.

The event broker calls methods on each registered extension whenever something interesting happens like an object was registered, an event is fired or a handler throws an exception. Extensions can be registered on the event broker:

Use Extensions for Exception Handling

Extensions provide a simple way to take control over exception handling.

When you call SetHandled() on the context then the event broker will not re-throw the exception.

The class EventBrokerExtensionBase simply implements all methods of IEventBrokerExtension with virtual methods so you only have to override the methods you are interested in.

Built-in extensions

Appccelerate contains the following extensions for the event broker: