Next: The HsConfigService
Up: The HsDispatcher Service
Previous: The StarGraph Class
Now that we have an undestanding of the type of structures we are
trying to observe, what type of events are services waiting for? The
following are the events generated by the HDM and their meaning:
- A HaystackEvent is generated for changes in the structure of the
graph. Specifically, there are two extensions to HaystackEvent:
- Whenever a change in graph structure happens (as indicated by
the setting of both the ``forward'' and ``back'' pointers of a
Tie) a HaystackCreateEvent is generated.
- When a Needle that is connected to at least one other
Straw has its data changed (by means of a
setData(...) invocation) a HaystackChangeEvent
is generated.
- An ObjectEvent is generated for changes and creations
in any independent Straw (regardless of what it is
connected to). This is useful for services that are interested in
keeping track of all object changes in the HDM (for example the
HsLore service will want to update each Straw
entered in the database as it happens). There are three types of
ObjectEvents:
- An ObjectCreateEvent is generated whenever a new HDM
object is created.
- An ObjectDeleteEvent is generated whenever an HDM
object is deleted.
- Finally, Haystack defines an abstract (i.e.
non-instantiatable) ObjectChangeEvent class. This
class is extended by two specific implementations:
- An ObjectChangeLinkEvent is generated when any
pointer (i.e. the pointers in Ties as well as the
StrawTies in Straw) are changed.
- An ObjectChangeDataEvent is generated when a
Needle's data is changed.
What we have indirectly achieved is the ability to differentiate
between different granularity of events, from structure to individial
``atomic'' components.
Copyright 1998, Eytan Adar (eytan@alum.mit.edu)