01: package org.shiftone.cache.policy.zero;
02:
03: import org.shiftone.cache.Cache;
04: import org.shiftone.cache.CacheFactory;
05:
06: /**
07: * Creates a cache that never stores anything you give it. This is a non-cache.
08: *
09: *
10: * @author <a href="mailto:jeff@shiftone.org">Jeff Drost</a>
11: * @version $Revision: 1.4 $
12: */
13: public class ZeroCacheFactory implements CacheFactory {
14:
15: public static final CacheFactory NULL_CACHE_FACTORY = new ZeroCacheFactory();
16: public static final Cache NULL_CACHE = new ZeroCache();
17:
18: /**
19: * Method newInstance
20: */
21: public Cache newInstance(String cacheName,
22: long timeoutMilliSeconds, int maxSize) {
23: return NULL_CACHE;
24: }
25:
26: public String toString() {
27: return "ZeroCacheFactory";
28: }
29: }
|