In Concordia, each object that receives events must implement an event handler. This is done by implementing the EventHandler interface. EventHandler is an interface that defines one method, handleEvent(), which is an application-specific event handler. This event handler is similar in function to event handlers found in other systems. It receives events and performs some action based on the type of event is has received.
The Agent class provides an empty handleEvent method, which subclasses must override if they wish to receive events.
Objects may choose to be notified of events either synchronously or asynchronously. The Agent class encapsulates this functionality within the makeEventHandler() method, which performs the required setup for an agent to receive either type of event notification. This method takes a boolean argument which indicates if events should be handled synchronously (i.e., an argument of true specifies synchronous event notification).
Event notification for non-mobile objects is more complex and will be discussed later.