com.graemestevenson.notifier
Class BlockingNotifier<T>

java.lang.Object
  extended by com.graemestevenson.notifier.AbstractNotifier<T>
      extended by com.graemestevenson.notifier.BlockingNotifier<T>
Type Parameters:
T - the type of data that the Notifier object handles.
All Implemented Interfaces:
Notifier<T>

public final class BlockingNotifier<T>
extends AbstractNotifier<T>

The blocking notifier is used to publish data to a set of interested subscribers, or Notifyees in a synchronous fashion.

A notifyee may be any object that implements interface Notifyee. When an application calling the Notifer's publish method causes all of its notifyees to be notified of the change by a call to their update method.

The order in which notifications will be delivered is the order in which they registered interest. This implementation carries out delivery on the same thread as the publish call, and therefore blocks until all notifiees have been updated.

When a notifier object is newly created, its set of notifyees is empty.

Author:
Graeme Stevenson (graeme.stevenson@ucd.ie)

Constructor Summary
BlockingNotifier()
           
 
Method Summary
 void publish(T some_data)
          Passes the some_data argument to all registered notifyees via their update method.
 
Methods inherited from class com.graemestevenson.notifier.AbstractNotifier
addNotifyee, countNotifyees, deleteNotifyee, deleteNotifyees, shutdown
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockingNotifier

public BlockingNotifier()
Method Detail

publish

public void publish(T some_data)
Passes the some_data argument to all registered notifyees via their update method. How this is handled is left to subclasses.

Specified by:
publish in interface Notifier<T>
Specified by:
publish in class AbstractNotifier<T>
Parameters:
some_data - the data to be passed to notifyees.