01: /*
02: * JFox - The most lightweight Java EE Application Server!
03: * more details please visit http://www.huihoo.org/jfox or http://www.jfox.org.cn.
04: *
05: * JFox is licenced and re-distributable under GNU LGPL.
06: */
07: package org.jfox.entity.cache;
08:
09: import java.io.Serializable;
10: import java.util.Collection;
11:
12: /**
13: * @author <a href="mailto:jfox.young@gmail.com">Young Yang</a>
14: */
15: public interface Cache {
16:
17: public String getName();
18:
19: public Collection<Serializable> keys();
20:
21: /**
22: * cache对象
23: *
24: * @param key id
25: * @param obj 需� cache 的对象
26: */
27: public void put(Serializable key, Serializable obj);
28:
29: /**
30: * 获得cache对象
31: *
32: * @param key id
33: */
34: public Serializable get(Serializable key);
35:
36: /**
37: * åˆ é™¤ä¸€ä¸ªcache的对象
38: *
39: * @param key id
40: * @return Serializable object removed
41: */
42: public Serializable remove(Serializable key);
43:
44: /**
45: * 判æ–对象是å?¦åœ¨cacheä¸
46: *
47: * @param key id
48: * @return true/false
49: */
50: public boolean contains(Serializable key);
51:
52: /**
53: * 清空cache
54: */
55: public void clear();
56:
57: /**
58: * 清除过期的对象
59: */
60: public void clean();
61:
62: /**
63: * 获得 Cache 的状�
64: */
65: public CacheStat getStatus();
66:
67: /**
68: * 获得 Cache 的Config
69: */
70: public CacheConfig getConfig();
71:
72: }
|