This
package defines the event classes for the AOCS Framework. The Framework
recognizes several types of events which are all derived from the AocsEvent class. This class is itself derived
from the EventObject class.
Each category of events has its own dedicated event class. The framework
predefines several types of event classes. Others may be defined by specific
applications. The framework event model complies with the JavaBeans event
model. There are however some differences in the way the events are used due to
the fact the framework does not allow dynamic creation of objects during normal
operation.
Consider for instance the case of an event source that needs to fire an event
of type EventType to its
event listeners. The source component maintains a statically defined instance
of EventType. Just
before firing the event, rather than creating a new event representing the
event to be fired (as is the case in ordinary JavaBeans applications), the
source components loads the statically defined event with the parameters
defining the event to be fired and passes this event to the fireEvent method. The event listeners will
then copy the parameters of the fired event into some internal storage and will
then release the fired event. In this way, the source component can use the
same EventType
instance for all event firings without needing to create new instances
dynamically.
As a consequence of the above, the parameters of the framework events must be
settable. This is why the source field in EventObject is not used and is assigned to a
dummy instance of Object at event creation.
Event handling is described in the Intercomponent
Communication Framelet document but note that this document was originally
written for the C++ version of the framework and hence it is not applicable in
its entirety.