1 25 26 package org.objectweb.perseus.cache.lib; 27 28 import org.objectweb.perseus.cache.api.UnFixProtocolException; 29 import org.objectweb.perseus.cache.replacement.api.ReplaceableCacheEntry; 30 31 36 public class BasicReplaceableCacheEntry implements ReplaceableCacheEntry { 37 38 Object o; 39 Object id; 40 int users; 41 long age; 42 43 public BasicReplaceableCacheEntry(Object id, Object o) { 44 this.o = o; 45 this.id = id; 46 } 47 48 49 52 public Object getCeObject() { 53 return o; 54 } 55 56 public Object getCeIdentifier() { 57 return id; 58 } 59 60 61 64 public void fixCe() { 65 users++; 66 } 67 68 public void unfixCe() throws UnFixProtocolException { 69 if (users == 0) { 70 throw new UnFixProtocolException(); 71 } 72 users--; 73 } 74 75 public int getCeFixCount() { 76 return users; 77 } 78 79 82 public long getCeAge () { 83 return age; 84 } 85 86 public void setCeAge (long age) { 87 this.age = age; 88 } 89 } 90 | Popular Tags |