Keeps track of all listeners to a JUnitModel, and has the ability
to notify them of some event.
This class has a specific role of managing JUnitListeners. Other
classes with similar names use similar code to perform the same function for
other interfaces, e.g. InteractionsEventNotifier and GlobalEventNotifier.
These classes implement the appropriate interface definition so that they
can be used transparently as composite packaging for a particular listener
interface.
Components which might otherwise manage their own list of listeners use
EventNotifiers instead to simplify their internal implementation. Notifiers
should therefore be considered a private implementation detail of the
components, and should not be used directly outside of the "host" component.
All methods in this class must use the synchronization methods
provided by ReaderWriterLock. This ensures that multiple notifications
(reads) can occur simultaneously, but only one thread can be adding
or removing listeners (writing) at a time, and no reads can occur
during a write.
No methods on this class should be synchronized using traditional
Java synchronization!
version: $Id: JUnitEventNotifier.java 4255 2007-08-28 19:17:37Z mgricken $ |