KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mmbase > cache > CacheImplementationInterface


1 /*
2
3 This software is OSI Certified Open Source Software.
4 OSI Certified is a certification mark of the Open Source Initiative.
5
6 The license (Mozilla version 1.0) can be read at the MMBase site.
7 See http://www.MMBase.org/license
8
9 */

10 package org.mmbase.cache;
11
12 import java.util.*;
13
14
15 /**
16  * Classes which can be used as a cache implementation need to implement this interface.
17  * An implementation of this interface has to be thread-safe to guarantee correctness.
18  *
19  * @author Michiel Meeuwissen
20  * @version $Id: CacheImplementationInterface.java,v 1.5 2006/02/23 17:36:55 michiel Exp $
21  * @since MMBase-1.8
22  */

23 public interface CacheImplementationInterface extends Map {
24
25     /**
26      * Sets the (maximal) size of the cache (if implementable).
27      */

28     void setMaxSize(int size);
29
30     /**
31      * Gets the (maximal) size of the cache (if implementable)
32      */

33     int maxSize();
34
35     /**
36      * Returns the hit-count on a certain key (if implementable).
37      */

38     int getCount(Object JavaDoc key);
39
40     /**
41      * Configure the implementation with the given configuration values
42      */

43     void config(Map configuration);
44
45 }
46
Popular Tags