net.sf.taverna.t2.lang.observer
Class MultiCaster<Message>

java.lang.Object
  extended by net.sf.taverna.t2.lang.observer.MultiCaster<Message>
Type Parameters:
Message -
All Implemented Interfaces:
Observable<Message>

public class MultiCaster<Message>
extends java.lang.Object
implements Observable<Message>

Send notifications to registered observers about changes to models

Author:
Ian Dunlop, Stian Soiland

Constructor Summary
MultiCaster(Observable<Message> observable)
          Set the observable ie.
 
Method Summary
 void addObserver(Observer<Message> observer)
          Register an observer ie.
 java.util.List<Observer<Message>> getObservers()
          A list of all the classes currently registered with this MultiCaster
 void notify(Message message)
          Tell all the registered observers about the change to the model
 void removeObserver(Observer<Message> observer)
          Remove the observer and no longer send out any notifications about it
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiCaster

public MultiCaster(Observable<Message> observable)
Set the observable ie. the class that changes are happening to and it's Message for this MultiCaster

Parameters:
observable -
Method Detail

notify

public void notify(Message message)
Tell all the registered observers about the change to the model

Parameters:
message -

addObserver

public void addObserver(Observer<Message> observer)
Register an observer ie. someone who wants informed about changes

Specified by:
addObserver in interface Observable<Message>
Parameters:
observer - the class who wants notified of changes

removeObserver

public void removeObserver(Observer<Message> observer)
Remove the observer and no longer send out any notifications about it

Specified by:
removeObserver in interface Observable<Message>
Parameters:
observer - the class who no longer wants notified

getObservers

public java.util.List<Observer<Message>> getObservers()
A list of all the classes currently registered with this MultiCaster

Specified by:
getObservers in interface Observable<Message>
Returns: