KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > shiftone > cache > policy > zero > ZeroCacheFactory


1 package org.shiftone.cache.policy.zero;
2
3
4
5 import org.shiftone.cache.Cache;
6 import org.shiftone.cache.CacheFactory;
7
8
9 /**
10  * Creates a cache that never stores anything you give it. This is a non-cache.
11  *
12  *
13  * @author <a HREF="mailto:jeff@shiftone.org">Jeff Drost</a>
14  * @version $Revision: 1.4 $
15  */

16 public class ZeroCacheFactory implements CacheFactory
17 {
18
19     public static final CacheFactory NULL_CACHE_FACTORY = new ZeroCacheFactory();
20     public static final Cache NULL_CACHE = new ZeroCache();
21
22     /**
23      * Method newInstance
24      */

25     public Cache newInstance(String JavaDoc cacheName, long timeoutMilliSeconds, int maxSize)
26     {
27         return NULL_CACHE;
28     }
29
30
31     public String JavaDoc toString()
32     {
33         return "ZeroCacheFactory";
34     }
35 }
36
Popular Tags