com.opensymphony.oscache.web.filter
Class ExpiresRefreshPolicy

java.lang.Object
  extended by com.opensymphony.oscache.web.filter.ExpiresRefreshPolicy
All Implemented Interfaces:
EntryRefreshPolicy, Serializable

public class ExpiresRefreshPolicy
extends Object
implements EntryRefreshPolicy

Checks if a cache filter entry has expired. This is useful when expires header are used in the response.

Version:
$Revision: 1.1 $
Author:
Lars Torunski
See Also:
Serialized Form

Constructor Summary
ExpiresRefreshPolicy(int refreshPeriod)
          Constructor ExpiresRefreshPolicy.
 
Method Summary
 boolean needsRefresh(CacheEntry entry)
          Indicates whether the supplied CacheEntry needs to be refreshed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpiresRefreshPolicy

public ExpiresRefreshPolicy(int refreshPeriod)
Constructor ExpiresRefreshPolicy.

Parameters:
refreshPeriod - the refresh period in seconds
Method Detail

needsRefresh

public boolean needsRefresh(CacheEntry entry)
Indicates whether the supplied CacheEntry needs to be refreshed. This will be called when retrieving an entry from the cache - if this method returns true then a NeedsRefreshException will be thrown.

Specified by:
needsRefresh in interface EntryRefreshPolicy
Parameters:
entry - The cache entry which is ignored.
Returns:
true if the content needs refreshing, false otherwise.
See Also:
NeedsRefreshException, CacheEntry

OSCache Project Page