1 package org.apache.jcs.auxiliary;
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.engine.behavior.ICacheEventQueue;
23
24 /***
25 * This has common attributes used by all auxiliaries.
26 * <p>
27 * @author aaronsm
28 *
29 */
30 public abstract class AbstractAuxiliaryCacheAttributes
31 implements AuxiliaryCacheAttributes
32 {
33 /***
34 * cacheName
35 */
36 protected String cacheName;
37
38 /***
39 * name
40 */
41 protected String name;
42
43 /***
44 * eventQueueType -- pooled or single threaded
45 */
46 protected int eventQueueType;
47
48 /***
49 * Named when pooled
50 */
51 protected String eventQueuePoolName;
52
53
54
55
56
57
58 public void setCacheName( String s )
59 {
60 this.cacheName = s;
61 }
62
63
64
65
66
67
68 public String getCacheName()
69 {
70 return this.cacheName;
71 }
72
73 /***
74 * This is the name of the auxiliary in configuration file.
75 * <p>
76 * @see org.apache.jcs.auxiliary.AuxiliaryCacheAttributes#setName(java.lang.String)
77 */
78 public void setName( String s )
79 {
80 this.name = s;
81 }
82
83
84
85
86
87
88 public String getName()
89 {
90 return this.name;
91 }
92
93
94
95
96
97
98 public void setEventQueueType( String s )
99 {
100 if ( s != null )
101 {
102 if ( s.equalsIgnoreCase( POOLED_QUEUE_TYPE ) )
103 {
104 this.eventQueueType = ICacheEventQueue.POOLED_QUEUE_TYPE;
105 }
106 else
107 {
108
109 this.eventQueueType = ICacheEventQueue.SINGLE_QUEUE_TYPE;
110 }
111 }
112 else
113 {
114
115 this.eventQueueType = ICacheEventQueue.SINGLE_QUEUE_TYPE;
116 }
117 }
118
119
120
121
122
123
124 public String getEventQueueType()
125 {
126 if ( this.eventQueueType == ICacheEventQueue.POOLED_QUEUE_TYPE )
127 {
128 return POOLED_QUEUE_TYPE;
129 }
130 else
131 {
132 return SINGLE_QUEUE_TYPE;
133 }
134 }
135
136
137
138
139
140
141 public int getEventQueueTypeFactoryCode()
142 {
143 return this.eventQueueType;
144 }
145
146
147
148
149
150
151 public void setEventQueuePoolName( String s )
152 {
153 eventQueuePoolName = s;
154 }
155
156
157
158
159
160
161 public String getEventQueuePoolName()
162 {
163 return eventQueuePoolName;
164 }
165
166 }