KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > shark > caching > LRUCacheMgr


1 /* LRUCacheMgr.java */
2
3 package org.enhydra.shark.caching;
4
5
6 import org.enhydra.shark.api.*;
7 import org.enhydra.shark.api.internal.caching.*;
8 import org.enhydra.shark.api.internal.working.CallbackUtilities;
9
10 /**
11  * This class creates and manages process cache and recource caches.
12  * These caches are LRU (least recently used mechanism) caches.
13  *
14  * @author Sasa Bojanic
15  * @author Tanja Jovanovic
16  */

17 public class LRUCacheMgr implements CacheMgr {
18
19    protected ProcessCache processes = null;
20    protected ResourceCache resources = null;
21
22    /**
23     * Configures caches.
24     *
25     * @param cus an instance of CallbackUtilities used to get
26     * properties for configuring caches.
27     * @exception RootException Thrown if an error occurs.
28     */

29    public void configure (CallbackUtilities cus) throws RootException {
30       processes=new LRUProcessCache();
31       processes.configure(cus);
32       resources=new LRUResourceCache();
33       resources.configure(cus);
34    }
35
36    /**
37     * Returns process cache.
38     *
39     * @return process cache.
40     */

41    public ProcessCache getProcessCache () {
42       return processes;
43    }
44
45    /**
46     * Returns resource cache.
47     *
48     * @return resource cache.
49     */

50    public ResourceCache getResourceCache() {
51       return resources;
52    }
53
54 }
55 /* End of LRUCacheMgr.java */
56
Popular Tags