A simple implementation of the event dispatcher interface. This implementation simply iterates over the set of registered observers and notifies each of the event in turn. This means that whatever thread the
Connection
object uses to call into this object will be blocked, from the
Connection
's point of view, until every observer has successfully processed the event.
Adding and removing observers from an instance of this class is protected against multi-threaded access. However, event and packet notification is not. If an event notification is currently in progress and another thread modifies the set of registered observers, then it is possible for the new observer to receive events before the call to addObserver
is complete.
@author Oran Kelly
@version $Id: SimpleEventDispatcher.java 293 2006-03-14 13:54:28Z orank $
@see ie.omk.smpp.event.EventDispatcher