fr.lifl.jedi.controllersCore.util
Class EventNotified

java.lang.Object
  extended by java.util.Observable
      extended by fr.lifl.jedi.controllersCore.util.EventNotified
All Implemented Interfaces:
java.util.Observer
Direct Known Subclasses:
SimulationCore

public abstract class EventNotified
extends java.util.Observable
implements java.util.Observer

Class used by the simulation core, to handle asynchronous events notification.

This class relies on the Observer/Observable pattern of java. Every time an observable notifies an event to this instance, an event is added to its event stack. An independent thread manages the processing of all events.

This was necessary in the previous versions of JEDI. Yet, modifications of the simualtion core were made since then. Thus, this solution might not be required any more.

Version:
JEDI V 2.2
Created the 17th nov. 2008
Created the 5th may 2009
Author:
Yoann Kubera
SMAC Team (Systèmes Multi-Agents et Comportement)
LIFL (Laboratoire d'Informatique Fondamentale de Lille)
University of Lille, France

Constructor Summary
EventNotified()
          Cosntructor of an element that is notified events.
 
Method Summary
abstract  void processEvent(java.util.Observable o, java.lang.Object event)
          A method that processes a particular event.
 void update(java.util.Observable o, java.lang.Object arg)
           
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventNotified

public EventNotified()
Cosntructor of an element that is notified events.

Method Detail

processEvent

public abstract void processEvent(java.util.Observable o,
                                  java.lang.Object event)
A method that processes a particular event.

Parameters:
o - The observer that sent the event.
event - The event to process

update

public void update(java.util.Observable o,
                   java.lang.Object arg)
Specified by:
update in interface java.util.Observer
See Also:
Observer.update(java.util.Observable, java.lang.Object)