Package org.castor.cache.hashbelt.reaper
Class RefreshingReaper
java.lang.Object
org.castor.cache.hashbelt.reaper.AbstractReaper
org.castor.cache.hashbelt.reaper.RefreshingReaper
- All Implemented Interfaces:
Reaper
Calls a refresh method on each object in the container; it reinserts any
returned object to the front of the expiration system. Useful for any object
that needs to be periodically refreshed from source; you are free to return
the same object that was called or to replace it with a refreshed version of
that object.
Note that you must supply the implementation of the refresh method.
- Since:
- 1.0
- Version:
- $Revision: 8102 $ $Date: 2006-04-25 16:09:10 -0600 (Tue, 25 Apr 2006) $
- Author:
- Gregory Block
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
handleExpiredContainer
(Container expiredContainer) Methode called with a container that has expired before the container is garbage collected.protected abstract Object
Function called to attempt to refresh the object.Methods inherited from class org.castor.cache.hashbelt.reaper.AbstractReaper
getCache, setCache
-
Constructor Details
-
RefreshingReaper
public RefreshingReaper()
-
-
Method Details
-
handleExpiredContainer
Methode called with a container that has expired before the container is garbage collected.- Parameters:
expiredContainer
- The container that has expired.
-
refresh
Function called to attempt to refresh the object. If refresh was successful, return the refreshed object; if not, return null.- Parameters:
objectToBeRefreshed
- The object to be refreshed.- Returns:
- The refreshed object, or null if the object could not be refreshed.
-