org.perfectjpattern.core.behavioral.observer
Class AsynchronousSubject<E>

java.lang.Object
  extended by org.perfectjpattern.core.behavioral.observer.Subject<E>
      extended by org.perfectjpattern.core.behavioral.observer.AsynchronousSubject<E>
Type Parameters:
E - Type of event data this ISubject notifies with.
All Implemented Interfaces:
ISubject<E>

public class AsynchronousSubject<E>
extends Subject<E>

Implementation of ISubject that notifies Observer instances from separate threads of execution.

Version:
$Revision: 1.0 $ $Date: Nov 13, 2007 10:28:42 PM $
Author:
Giovanni Azua
See Also:
Subject
 

Field Summary
 
Fields inherited from class org.perfectjpattern.core.behavioral.observer.Subject
EMPTY_ARRAY
 
Constructor Summary
AsynchronousSubject()
           
 
Method Summary
 void notifyObservers(E anEventData)
          Notifies the attached IObserver instances that a change has occurred.
 
Methods inherited from class org.perfectjpattern.core.behavioral.observer.Subject
attach, clear, detach, getObservers, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsynchronousSubject

public AsynchronousSubject()
Method Detail

notifyObservers

public void notifyObservers(E anEventData)
Notifies the attached IObserver instances that a change has occurred. It is compulsory to provide a non null parameter anEventData. For situations where passing information is not required use instead NullEventData singleton instance.

Specified by:
notifyObservers in interface ISubject<E>
Overrides:
notifyObservers in class Subject<E>
Parameters:
anEventData - Event data pushed to IObserver instances.


Copyright © 2007-2009. All Rights Reserved.