KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > shark > api > internal > caching > ObjectCache


1 /* CacheMgr.java */
2
3 package org.enhydra.shark.api.internal.caching;
4
5 import org.enhydra.shark.api.RootException;
6
7 import org.enhydra.shark.api.internal.working.CallbackUtilities;
8 /**
9  * Interface for basic cache methods.
10  * @author Sasa Bojanic
11  * @author Tanja Jovanovic
12  */

13 public interface ObjectCache {
14
15    /**
16     * Configures cache.
17     *
18     * @param cus an instance of CallbackUtilities used to get
19     * properties for configuring cache.
20     * @exception RootException Thrown if an error occurs.
21     */

22    void configure (CallbackUtilities cus) throws RootException;
23
24    /**
25     * Sets size of the cache to value <i>size</i>. The value 0 means that the
26     * cache is disabled. The negative value means that the cache is unbounded.
27     * The positive number defines max number of cache entries.
28     *
29     * @param size new size of the cache.
30     * @exception RootException Thrown if an error occurs.
31     */

32    public void setSize (int size) throws RootException;
33
34    /**
35     * Returns the size of the cache.
36     *
37     * @return Size of the cache.
38     * @exception RootException Thrown if an error occurs.
39     */

40    public int getSize () throws RootException;
41
42    /**
43     * Returns the number of entries in the cache.
44     *
45     * @return The number of entries in the cache.
46     * @exception RootException Thrown if an error occurs.
47     */

48    public int howManyEntries () throws RootException;
49
50    /**
51     * Returns all values from the cache.
52     *
53     * @return All values from the cache as List.
54     * @exception RootException Thrown if an error occurs.
55     */

56    public java.util.List JavaDoc getAll () throws RootException;
57
58 }
59
60
Popular Tags