uk.org.ogsadai.common.properties
Class PropertyEventDispatcher

java.lang.Object
  |
  +--uk.org.ogsadai.common.properties.PropertyEventDispatcher
All Implemented Interfaces:
PropertyListener

public class PropertyEventDispatcher
extends java.lang.Object
implements PropertyListener

A thread-safe class for dispatching property events to a collection of property listeners.

This class implements the PropertyListener interface for the sake of consistency. Each time one of the methods of this interface is invoked, the corresponding event will be dispatched to each of the registered listeners.

Author:
The OGSA-DAI Project Team

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
           
private  java.util.Collection mListeners
           
 
Constructor Summary
PropertyEventDispatcher()
           
 
Method Summary
 void addPropertyListener(PropertyListener listener)
          Registers a property listner which will be notified of subsequent property events.
 void propertyAdded(PropertyEvent event)
          Handles the property added event by invoking the propertyAdded() method on each property listener.
 void propertyRemoved(PropertyEvent event)
          Handles the property removed event by invoking the propertyRemoved() method on each property listener.
 void propertyUpdated(PropertyEvent event)
          Handles the property updated event by invoking the propertyUpdated() method on each property listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
See Also:
Constant Field Values

mListeners

private final java.util.Collection mListeners
Constructor Detail

PropertyEventDispatcher

public PropertyEventDispatcher()
Method Detail

addPropertyListener

public void addPropertyListener(PropertyListener listener)
Registers a property listner which will be notified of subsequent property events.

Parameters:
listener - The PropertyListener to register
Throws:
java.lang.IllegalArgumentException - if listener is null.

propertyAdded

public void propertyAdded(PropertyEvent event)
Handles the property added event by invoking the propertyAdded() method on each property listener.

Specified by:
propertyAdded in interface PropertyListener
Parameters:
event - Describes details of the event.
Throws:
java.lang.IllegalArgumentException - if event is null.
See Also:
PropertyListener.propertyAdded(uk.org.ogsadai.common.properties.PropertyEvent)

propertyRemoved

public void propertyRemoved(PropertyEvent event)
Handles the property removed event by invoking the propertyRemoved() method on each property listener.

Specified by:
propertyRemoved in interface PropertyListener
Parameters:
event - Describes details of the event.
Throws:
java.lang.IllegalArgumentException - if event is null.
See Also:
PropertyListener.propertyRemoved(uk.org.ogsadai.common.properties.PropertyEvent)

propertyUpdated

public void propertyUpdated(PropertyEvent event)
Handles the property updated event by invoking the propertyUpdated() method on each property listener.

Specified by:
propertyUpdated in interface PropertyListener
Parameters:
event - Describes details of the event.
Throws:
java.lang.IllegalArgumentException - if event is null.