com.opensymphony.oscache.web.filter
Class ExpiresRefreshPolicy
java.lang.Object
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: 411 $
- Author:
- Lars Torunski
- See Also:
- Serialized Form
Field Summary |
private long |
refreshPeriod
the refresh period (in milliseconds) of a certain cache filter |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
refreshPeriod
private long refreshPeriod
- the refresh period (in milliseconds) of a certain cache filter
ExpiresRefreshPolicy
public ExpiresRefreshPolicy(int refreshPeriod)
- Constructor ExpiresRefreshPolicy.
- Parameters:
refreshPeriod
- the refresh period in seconds
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
getRefreshPeriod
public long getRefreshPeriod()
- Returns:
- the refreshPeriod in seconds
- Since:
- 2.4
setRefreshPeriod
public void setRefreshPeriod(long refreshPeriod)
- Parameters:
refreshPeriod
- the refresh period in seconds- Since:
- 2.4
Copyright © 2011 OpenSymphony. All Rights Reserved.