1 21 22 package com.rift.coad.lib.bean; 24 25 import java.util.Date ; 27 28 import com.rift.coad.lib.cache.Cache; 30 import com.rift.coad.lib.cache.CacheEntry; 31 32 33 38 public class ProxyCacheEntry implements CacheEntry { 39 private long timeout = -1; 41 private Object proxy = null; 42 private CacheEntry cacheEntry = null; 43 44 45 52 public ProxyCacheEntry(long timeout, Object proxy, CacheEntry cacheEntry) { 53 this.timeout = timeout; 54 this.proxy = proxy; 55 this.cacheEntry = cacheEntry; 56 } 57 58 59 62 public void touch() { 63 } 65 66 67 74 public boolean isExpired(Date expiryDate) { 75 if (timeout <= 0) { 77 return false; 78 } 79 Date calculatedExpiry = new Date (expiryDate.getTime() - timeout); 80 return cacheEntry.isExpired(calculatedExpiry); 81 } 82 83 84 87 public void cacheRelease() { 88 cacheEntry.cacheRelease(); 89 } 90 91 92 95 public CacheEntry getCacheEntry() { 96 return cacheEntry; 97 } 98 } 99 100 101 | Popular Tags |