net.sf.mmm.util.component.api
Interface PeriodicRefresher

All Known Implementing Classes:
PeriodicRefresherImpl

@ComponentSpecification
public interface PeriodicRefresher

This is the interface for a component that periodically refreshes registered Refreshables. The refresh of a Refreshable will happen until it is de-registered.

Since:
1.0.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)

Method Summary
 void addRefreshable(Refreshable refreshable)
          This method will register the given refreshable so it will be refreshed periodically.
 void removeRefreshable(Refreshable refreshable)
          This method removes the given refreshable from this PeriodicRefresher.
 

Method Detail

addRefreshable

void addRefreshable(Refreshable refreshable)
This method will register the given refreshable so it will be refreshed periodically.
A common implementation will use a central thread that is started if the first Refreshable is added here.
ATTENTION:
Please be careful with automatic refreshes and only add a Refreshable if this is really desired and its implementation of Refreshable.refresh() is fast or only takes performance if something that rarely changes has been modified.
Further the given Refreshable has to have a proper implementation of Object.equals(Object) and Object.hashCode() as it may be stored in a Collection.

Parameters:
refreshable - is the Refreshable to register and refresh periodically.

removeRefreshable

void removeRefreshable(Refreshable refreshable)
This method removes the given refreshable from this PeriodicRefresher. This will typically happen when the according Refreshable shall be closed or disposed.
If the given searchEngine has never been registered, this method has no effect.

Parameters:
refreshable - is the Refreshable to de-register.


Copyright © 2001-2010 mmm-Team. All Rights Reserved.