Skip navigation links
CASA Knowledge Science Group
Dept of Computer Science
Univeristy of Calgary

Package casa.event

Contains classes that implement Events (see Event), which are used to describe dependencies (including time expiry or time intervals) among things like social commitments and deferred code.

See: Description

Package casa.event Description

Contains classes that implement Events (see Event), which are used to describe dependencies (including time expiry or time intervals) among things like social commitments and deferred code.

The Event interface describes an interrupt style event. Each event must have access to a thread to monitor or wait for the event to occur. When it does, it queues the event to it's agent's event queue, and this agent is responsible for eventually executing its Event.fireEvent() method which informs all observers of the event. The agents queue fits into the grand scheme of things as follows:

All events have an event type (a string that should be in the agent's ontology), which may be used by the event observers to distinguish between multiple events it is observing.

If an observer wishes to be informed of the occurrence of the event, it must implement the EventObserver interface. The observer object must also be passed on to casa.event.Event#addEventObserver(EventObserver). If the observer is added before Event.start() is called, it is guaranteed to be informed of the event's occurrence. If not, there is no guarantee. When the event occurs, EventObserver.notifyEventOccurred(String,Event,Object) is called for all registered observers.

A simple class diagram of events follows:

Copyright: Copyright (c) 2002-2008, Knowledge Science Group, University of Calgary. Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The Knowledge Science Group makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.
Skip navigation links
CASA Knowledge Science Group
Dept of Computer Science
Univeristy of Calgary