| 1 21 22 package com.rift.coad.lib.deployment.rmi; 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 RMICacheEntry implements CacheEntry { 39 private long timeout = -1; 41 private CacheEntry cacheEntry = null; 42 43 44 50 public RMICacheEntry(long timeout, CacheEntry cacheEntry) { 51 this.timeout = timeout; 52 this.cacheEntry = cacheEntry; 53 } 54 55 56 59 public void touch() { 60 } 62 63 64 71 public boolean isExpired(Date expiryDate) { 72 if (timeout <= 0) { 74 return false; 75 } 76 Date calculatedExpiry = new Date (expiryDate.getTime() - timeout); 77 return cacheEntry.isExpired(calculatedExpiry); 78 } 79 80 81 84 public void cacheRelease() { 85 cacheEntry.cacheRelease(); 86 } 87 88 89 92 public CacheEntry getCacheEntry() { 93 return cacheEntry; 94 } 95 96 97 102 public java.rmi.Remote getRemoteInterface() { 103 return (java.rmi.Remote )cacheEntry; 104 } 105 } | Popular Tags |