01: /*
02: * CoadunationLib: The coaduntion implementation library.
03: * Copyright (C) 2006 Rift IT Contracting
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation; either
08: * version 2.1 of the License, or (at your option) any later version.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library; if not, write to the Free Software
17: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18: *
19: * CacheEntry.java
20: *
21: * This is a basic generic cache entry interface. It can be used by classes
22: * needing to be placed in a cache.
23: */
24:
25: // package path
26: package com.rift.coad.lib.cache;
27:
28: // java imports
29: import java.util.Date;
30:
31: /**
32: * This is a basic generic cache entry interface. It can be used by classes
33: * needing to be placed in a cache.
34: *
35: * @author Brett Chaldecott
36: */
37: public interface CacheEntry {
38: /**
39: * The touch method use to update the last touch time of a cache entry.
40: */
41: public void touch();
42:
43: /**
44: * This method will return true if the date is older than the given expiry
45: * date.
46: *
47: * @return TRUE if expired FALSE if not.
48: * @param expiryDate The expiry date to perform the check with.
49: */
50: public boolean isExpired(Date expiryDate);
51:
52: /**
53: * This method is called by the cache when an object is removed.
54: */
55: public void cacheRelease();
56: }
|