org.exist.fluent
Class Folder.ListenersFacet

java.lang.Object
  extended by org.exist.fluent.Folder.ListenersFacet
Enclosing class:
Folder

public class Folder.ListenersFacet
extends Object

The facet that allwos control over listeners to the folder, and all its descendant folders and documents.

Author:
Piotr Kaminski

Constructor Summary
Folder.ListenersFacet()
           
 
Method Summary
 void add(Set<Trigger> triggers, Listener listener)
          Add a listener for either folder or document events on this folder, its contents, and all its descendants and their contents as well.
 void add(Trigger trigger, Listener listener)
          Add a listener for either folder or document events on this folder, its contents, and all its descendants and their contents as well.
 void remove(Listener listener)
          Remove a listener previously added through this facet.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Folder.ListenersFacet

public Folder.ListenersFacet()
Method Detail

add

public void add(Trigger trigger,
                Listener listener)
Add a listener for either folder or document events on this folder, its contents, and all its descendants and their contents as well. Equivalent to add(EnumSet.of(trigger), listener).

Parameters:
trigger - the kind of event the listener should be notified of
listener - the listener to notify of events
See Also:
add(Set, org.exist.fluent.Listener)

add

public void add(Set<Trigger> triggers,
                Listener listener)
Add a listener for either folder or document events on this folder, its contents, and all its descendants and their contents as well. The listener's type (either Document.Listener or Folder.Listener) will determine the kinds of events it will receive. Note that if the listener implements both interfaces it will be notified of events that concern both documents and folders (and satisfy the timing and action characteristics requested).

Parameters:
triggers - the kinds of events the listener should be notified of; the set must not be empty
listener - the listener to notify of events

remove

public void remove(Listener listener)
Remove a listener previously added through this facet. This will remove the listener from all combinations of timing and action for this folder, even if added via multiple invocations of the add methods. However, it will not remove the listener from combinations added through other facets, even this folder's documents facet or the facets of any descendants.

Parameters:
listener - the listener to remove


Copyright (C) All rights reserved.