KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > info > magnolia > cms > cache > noop > NoOpCache


1 package info.magnolia.cms.cache.noop;
2
3 import info.magnolia.cms.cache.Cache;
4 import info.magnolia.cms.cache.CacheConfig;
5 import info.magnolia.cms.cache.CacheKey;
6 import info.magnolia.cms.cache.CacheableEntry;
7
8 import javax.servlet.http.HttpServletRequest JavaDoc;
9 import javax.servlet.http.HttpServletResponse JavaDoc;
10
11
12 /**
13  * A <code>Cache</code> implementation that does nothing.
14  * @author Andreas Brenk
15  * @author Fabrizio Giustina
16  * @since 3.0
17  */

18 public class NoOpCache implements Cache {
19
20     /**
21      * Does nothing.
22      */

23     public void cacheRequest(HttpServletRequest JavaDoc request) {
24     }
25
26     /**
27      * Does nothing.
28      */

29     public void flush() {
30     }
31
32     /**
33      * Does nothing.
34      * @return <code>Cache.UNKNOWN_CREATION_TIME</code>
35      */

36     public long getCreationTime(HttpServletRequest JavaDoc request) {
37         return Cache.UNKNOWN_CREATION_TIME;
38     }
39
40     /**
41      * Does nothing.
42      */

43     public void start(CacheConfig config) {
44     }
45
46     /**
47      * Does nothing.
48      * @return <code>false</code>
49      */

50     public boolean isCached(CacheKey request) {
51         return false;
52     }
53
54     /**
55      * Does nothing.
56      */

57     public void stop() {
58     }
59
60     /**
61      * Does nothing.
62      * @return <code>false</code>
63      */

64     public boolean streamFromCache(HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response, boolean canCompress) {
65         return false;
66     }
67
68     /**
69      * @see info.magnolia.cms.cache.Cache#cacheRequest(info.magnolia.cms.cache.CacheKey,
70      * info.magnolia.cms.cache.CacheableEntry, boolean)
71      */

72     public void cacheRequest(CacheKey key, CacheableEntry out, boolean canCompress) {
73
74     }
75
76     /**
77      * @see info.magnolia.cms.cache.Cache#getCreationTime(info.magnolia.cms.cache.CacheKey)
78      */

79     public long getCreationTime(CacheKey request) {
80         return 0;
81     }
82
83     /**
84      * @see info.magnolia.cms.cache.Cache#streamFromCache(info.magnolia.cms.cache.CacheKey,
85      * javax.servlet.http.HttpServletResponse, boolean)
86      */

87     public boolean streamFromCache(CacheKey key, HttpServletResponse JavaDoc response, boolean canCompress) {
88         return false;
89     }
90
91     /**
92      * @see info.magnolia.cms.cache.Cache#flushEntry(info.magnolia.cms.cache.CacheKey)
93      */

94     public void remove(CacheKey key) {
95
96     }
97
98 }
99
Popular Tags