01: /*
02: * Copyright (c) 2002-2003 by OpenSymphony
03: * All rights reserved.
04: */
05: package com.opensymphony.oscache.base;
06:
07: import java.io.Serializable;
08:
09: /**
10: * Interface that allows custom code to be called when checking to see if a cache entry
11: * has expired. This is useful when the rules that determine when content needs refreshing
12: * are beyond the base funtionality offered by OSCache.
13: *
14: * @version $Revision: 254 $
15: * @author <a href="mailto:fbeauregard@pyxis-tech.com">Francois Beauregard</a>
16: */
17: public interface EntryRefreshPolicy extends Serializable {
18: /**
19: * Indicates whether the supplied <code>CacheEntry</code> needs to be refreshed.
20: * This will be called when retrieving an entry from the cache - if this method
21: * returns <code>true</code> then a <code>NeedsRefreshException</code> will be
22: * thrown.
23: *
24: * @param entry The cache entry that is being tested.
25: * @return <code>true</code> if the content needs refreshing, <code>false</code> otherwise.
26: *
27: * @see NeedsRefreshException
28: * @see CacheEntry
29: */
30: public boolean needsRefresh(CacheEntry entry);
31: }
|