How can events be filtered?

Bruce Martin

Often times a consumer is only interested in some of the events produced by a supplier. For example, consider a stock portfolio object. It is interested in stock change events for particular stocks and when a stock price goes above or below a certain price. It does not want to receive all stock change events for all stocks.

The first filtering mechanism is the event channel itself. By using multiple event channels to represent different types of events, the space of events is partitioned. Thus, the suppliers only connect to the event channels that they are interested in. In the above example, we might have one event channel per stock.

But this partitioning of events helps but is insufficient. The supplier's condition for being interested in the event may be based on the data associated with the event. In the above example, the price is part of the event data.

To achieve this kind of filter in the CORBA Event Service, the application developer simply implements a simple filter. The filter is a consumer of events that is attached to the event channel. If the filter evaluates to true, it passes the event on to its consumer. If the filter evaluates to false, it simply drops the event. In this fashion, the consumer only receives the events of interest. Obviously the filter should be located near the channel.

he slow communication link once.
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact