1 package org.apache.jcs.auxiliary.lateral;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.jcs.auxiliary.AuxiliaryCache;
23 import org.apache.jcs.auxiliary.AuxiliaryCacheAttributes;
24 import org.apache.jcs.auxiliary.AuxiliaryCacheFactory;
25 import org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheAttributes;
26 import org.apache.jcs.engine.behavior.ICompositeCacheManager;
27
28
29 /***
30 * Particular lateral caches should define their own factory. It is
31 * not necessary to extend this base factory, but it can be useful.
32 * <p>
33 * The old factory tried to handle all types of laterals. It was
34 * gettting cluttered by ad hoc if statements. Since the javagroups
35 * lateral was jdk1.4 dependent it had to be moved. As such, the
36 * old factory could no longer import it. This motivated the change.
37 * <p>
38 * This abstraction layer should keep things cleaner.
39 * <p>
40 * @author Aaron Smuts
41 */
42 public abstract class LateralCacheAbstractFactory
43 implements AuxiliaryCacheFactory
44 {
45
46 private String name;
47
48
49
50
51 public abstract AuxiliaryCache createCache( AuxiliaryCacheAttributes attr, ICompositeCacheManager cacheMgr );
52
53 /***
54 * Makes sure a listener gets created. It will get monitored as soon as it
55 * is used.
56 * <p>
57 * This should be called by create cache.
58 * <p>
59 * @param lac ILateralCacheAttributes
60 * @param cacheMgr
61 */
62 public abstract void createListener( ILateralCacheAttributes lac, ICompositeCacheManager cacheMgr );
63
64 /***
65 * Gets the name attribute of the LateralCacheFactory object
66 * <p>
67 * @return The name value
68 */
69 public String getName()
70 {
71 return this.name;
72 }
73
74 /***
75 * Sets the name attribute of the LateralCacheFactory object
76 * <p>
77 * @param name
78 * The new name value
79 */
80 public void setName( String name )
81 {
82 this.name = name;
83 }
84 }