ca.odell.glazedlists.event
Class ListEventPublisher

java.lang.Object
  extended by ca.odell.glazedlists.event.ListEventPublisher

public final class ListEventPublisher
extends Object

Manager for distributing ListEvents to ListEventListeners. Because ListEvents must be forwarded in a safe order, the ListEventPublisher manages dependencies between ListEventListeners and EventLists. Therefore any ListEventListener that fires ListEvents from within the listChanged() method shall share the ListEventPublisher with its source EventList.

Author:
Jesse Wilson

Constructor Summary
ListEventPublisher()
          Creates a ListEventPublisher.
 
Method Summary
 void addDependency(EventList dependency, ListEventListener listener)
          Requires that the specified EventList be updated before the specified ListEventListener which depends on it.
 boolean dependenciesSatisfied(ListEventListener listener)
          Returns true if the specified ListEventListener's required dependencies have been satisfied.
 boolean dependenciesSatisfied(ca.odell.glazedlists.event.ListEventPublisher.DependentListener dependentListener)
           
 void removeDependency(EventList dependency, ListEventListener listener)
          Removes the specified EventList as a dependency for the specified ListEventListener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListEventPublisher

public ListEventPublisher()
Creates a ListEventPublisher.

Method Detail

addDependency

public void addDependency(EventList dependency,
                          ListEventListener listener)
Requires that the specified EventList be updated before the specified ListEventListener which depends on it. Dependencies are automatically managed by most EventLists, so this method shall only be used for EventLists that have indirect dependencies.


removeDependency

public void removeDependency(EventList dependency,
                             ListEventListener listener)
Removes the specified EventList as a dependency for the specified ListEventListener. This ListEventListener will continue to receive ListEvents, but there will be no dependency tracking when such events are fired.


dependenciesSatisfied

public boolean dependenciesSatisfied(ListEventListener listener)
Returns true if the specified ListEventListener's required dependencies have been satisfied.

A dependency has been satisfied if it has been notified of the current event, either directly or indirectly.

A dependency is required if it is dependent on the event's cause, either directly or indirectly.

This method is currently broken. If an EventList fails to forward any events, it may cause a source EventList to be unsatisfied.


dependenciesSatisfied

public boolean dependenciesSatisfied(ca.odell.glazedlists.event.ListEventPublisher.DependentListener dependentListener)


Glazed Lists 1.5.0, Copyright © 2003-2005 publicobject.com, O'Dell Engineering.
Documentation build by James Lemieux at 2005-12-21 23:25