01: /*
02:
03: This software is OSI Certified Open Source Software.
04: OSI Certified is a certification mark of the Open Source Initiative.
05:
06: The license (Mozilla version 1.0) can be read at the MMBase site.
07: See http://www.MMBase.org/license
08:
09: */
10: package org.mmbase.cache;
11:
12: import java.util.List;
13:
14: import org.mmbase.module.core.MMObjectNode;
15:
16: /**
17: * Cache from MMObjectNode number to List of InsRel MMObjectNodes instances (relation nodes).
18: * Used in MMObjectNode.
19: *
20: * @author Michiel Meeuwissen
21: * @version $Id: RelationsCache.java,v 1.4 2007/02/11 19:21:11 nklasens Exp $
22: * @see org.mmbase.module.core.MMObjectNode#getRelations
23: * @see org.mmbase.module.core.MMObjectNode#getRelationNodes
24: * @since MMBase-1.7
25: */
26:
27: public class RelationsCache extends Cache<Integer, List<MMObjectNode>> {
28:
29: // There will be only one list cache, and here it is:
30: private static RelationsCache relationsCache;
31:
32: public static RelationsCache getCache() {
33: return relationsCache;
34: }
35:
36: static {
37: relationsCache = new RelationsCache(300);
38: relationsCache.putCache();
39: }
40:
41: public String getName() {
42: return "RelationsCache";
43: }
44:
45: public String getDescription() {
46: return "Caches relations to/from a certain node";
47: }
48:
49: /**
50: * Creates the Node list cache.
51: */
52: private RelationsCache(int size) {
53: super(size);
54: }
55:
56: }
|