KickJava   Java API By Example, From Geeks To Geeks.

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


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 /**
13  * Cache from MMObjectNode number to List of InsRel MMObjectNodes instances (relation nodes).
14  * Used in MMObjectNode.
15  *
16  * @author Michiel Meeuwissen
17  * @version $Id: RelationsCache.java,v 1.3 2005/01/30 16:46:37 nico Exp $
18  * @see org.mmbase.module.core.MMObjectNode#getRelations
19  * @see org.mmbase.module.core.MMObjectNode#getRelationNodes
20  * @since MMBase-1.7
21  */

22
23
24 public class RelationsCache extends Cache {
25
26     // There will be only one list cache, and here it is:
27
private static RelationsCache relationsCache;
28
29     public static RelationsCache getCache() {
30         return relationsCache;
31     }
32
33     static {
34         relationsCache = new RelationsCache(300);
35         relationsCache.putCache();
36     }
37
38     public String JavaDoc getName() {
39         return "RelationsCache";
40     }
41     public String JavaDoc getDescription() {
42         return "Caches relations to/from a certain node";
43     }
44
45     
46     /**
47      * Creates the Node list cache.
48      */

49     private RelationsCache(int size) {
50         super(size);
51     }
52         
53 }
54
Popular Tags