next up previous contents
Next: Data manipulation Services Up: The Haystack Service Model Previous: The HsCommandLine Service

Event Driven Services

  A number of event driven services are described in the next sections However, a brief summary of their design is provided here. Services interested in listening for events (i.e. changes in the HDM) extend the class haystack.service.events.HaystackEventService. This class provides the basic functionality necessary to register the service with the HsDispatcher to be notified of specific events (HaystackEvents and/or ObjectEvents).

Event driven services are different than other Haystack services in two ways. Services that extend the HaystackEventService class will also implement the interface HaystackEventListener and/or ObjectEventListener. The functions defined by each of these ``handle'' the events generated by the HDM. We also impose the invariant that any service modifying a piece of data in HDM must lock the HDM object first in the HsResourceControlService. This prevents a number of race conditions, and allows us to decide when an object has reached stable state (when it hasn't been locked for a long time).



Copyright 1998, Eytan Adar (eytan@alum.mit.edu)