back

Event subsystem


Topic based event handling

Another very important issue in case of loose coupling is a name based event mechanism - just like the java messaging services.

The realization is rather simple:
  • The sender of interesting events define those by publishing a string based topic like topic:/infrastructure/cluster/new - just like a contract
  • Each consumer of those events registers delegates with the same topic name
  • By publishing new events to a given topic name the event subsystem distributes this incoming event arguments to all registered delegates

Important: This works only in-proc!

Sample: Cluster awareness

For example the cluster participant manager object realizes changes (new or leaving partners) in the cluster community. Those events will be published to the event subsystem. And the registry is interested in those events and registers two delegates for those two topics. Now the registry can record for itself the list of other existing registries in the system.

Design



It can be seen that the topic (like already said) is a string and the passed arguments also. Therefore the information is not a "castable" object but a mere trigger.

In order to decouple event publishing from delegate activation the event manager provides a queue for incoming events. The thread of the event manager realizes pending actions and distributes the passed arguments to the defined topic by delegate activation.



back

Last edited Jun 14, 2010 at 5:56 AM by harkon, version 1

Comments

No comments yet.