wicket.util.watch
Class ModificationWatcher

java.lang.Object
  extended by wicket.util.watch.ModificationWatcher

public final class ModificationWatcher
extends java.lang.Object

Monitors one or more Modifiable objects, calling a ChangeListener when a given object's modification time changes.

Author:
Jonathan Locke

Constructor Summary
ModificationWatcher()
          For two-phase construction
ModificationWatcher(Duration pollFrequency)
          Constructor
 
Method Summary
 boolean add(IModifiable modifiable, IChangeListener listener)
          Adds a Modifiable object and an IChangeListener to call when the modifiable object is modified.
 void destroy()
          stops the modification watcher from watching.
 IModifiable remove(IModifiable modifiable)
          Remove all entries associated with 'modifiable'
 void start(Duration pollFrequency)
          Start watching at a given polling rate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModificationWatcher

public ModificationWatcher()
For two-phase construction


ModificationWatcher

public ModificationWatcher(Duration pollFrequency)
Constructor

Parameters:
pollFrequency - How often to check on modifiables
Method Detail

add

public final boolean add(IModifiable modifiable,
                         IChangeListener listener)
Adds a Modifiable object and an IChangeListener to call when the modifiable object is modified.

Parameters:
modifiable - The modifiable thing to monitor
listener - The listener to call if the modifiable is modified
Returns:
true if the set did not already contain the specified element.

remove

public IModifiable remove(IModifiable modifiable)
Remove all entries associated with 'modifiable'

Parameters:
modifiable -
Returns:
the object removed, else null

start

public void start(Duration pollFrequency)
Start watching at a given polling rate

Parameters:
pollFrequency - The poll rate

destroy

public void destroy()
stops the modification watcher from watching.



Copyright © 2004-2007 Wicket developers. All Rights Reserved.