1 /***
2 * Copyright 2003-2010 Terracotta, Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 package net.sf.ehcache.management;
18
19 /***
20 * A JMX MBean interface for the configuration of a cache
21 * @author Greg Luck
22 * @version $Id: CacheConfigurationMBean.html 13146 2011-08-01 17:12:39Z oletizi $
23 * @since 1.3
24 */
25 public interface CacheConfigurationMBean {
26
27 /***
28 * Accessor
29 */
30 String getName();
31
32 /***
33 * Accessor
34 */
35 boolean isLoggingEnabled();
36
37 /***
38 * setLoggingEnabled
39 *
40 * @param loggingEnabled
41 */
42 void setLoggingEnabled(boolean loggingEnabled);
43
44 /***
45 * Accessor
46 *
47 * @deprecated use {@link #getMaxEntriesLocalHeap()}
48 */
49 @Deprecated
50 int getMaxElementsInMemory();
51
52 /***
53 * setMaxElementsInMemory
54 *
55 * @param maxElements
56 * @deprecated use {@link #setMaxEntriesLocalHeap(long)}
57 */
58 @Deprecated
59 void setMaxElementsInMemory(int maxElements);
60
61 /***
62 * Accessor
63 *
64 * @deprecated use {@link #getMaxEntriesLocalDisk()}
65 */
66 @Deprecated
67 int getMaxElementsOnDisk();
68
69 /***
70 * setMaxElementsOnDisk
71 *
72 * @param maxElements
73 * @deprecated use {@link #setMaxEntriesLocalDisk(long)}
74 */
75 @Deprecated
76 void setMaxElementsOnDisk(int maxElements);
77
78 /***
79 * Configured maximum number of entries for the local disk store.
80 */
81 long getMaxEntriesLocalDisk();
82
83 /***
84 * Configured maximum number of entries for the local memory heap.
85 */
86 long getMaxEntriesLocalHeap();
87
88 /***
89 * Configured maximum number of entries for the local disk store.
90 */
91 void setMaxEntriesLocalDisk(long maxEntries);
92
93 /***
94 * Configured maximum number of entries for the local memory heap.
95 */
96 void setMaxEntriesLocalHeap(long maxEntries);
97
98 /***
99 * Configured maximum number of bytes for the local disk store.
100 */
101 long getMaxBytesLocalDisk();
102
103 /***
104 * Configured maximum number of bytes for the local memory heap.
105 */
106 long getMaxBytesLocalHeap();
107
108 /***
109 * Configured maximum number of bytes for the local off-heap memory.
110 */
111 long getMaxBytesLocalOffHeap();
112
113 /***
114 * Accessor
115 * @return a String representation of the policy
116 */
117 String getMemoryStoreEvictionPolicy();
118
119 /***
120 * setMemoryStoreEvictionPolicy
121 *
122 * @param policy
123 */
124 void setMemoryStoreEvictionPolicy(String policy);
125
126 /***
127 * Accessor
128 */
129 boolean isEternal();
130
131 /***
132 * setEternal
133 *
134 * @param eternal
135 */
136 void setEternal(boolean eternal);
137
138 /***
139 * Accessor
140 */
141 long getTimeToIdleSeconds();
142
143 /***
144 * setTimeToIdleSeconds
145 *
146 * @param tti
147 */
148 void setTimeToIdleSeconds(long tti);
149
150 /***
151 * Accessor
152 */
153 long getTimeToLiveSeconds();
154
155 /***
156 * setTimeToLiveSeconds
157 *
158 * @param ttl
159 */
160 void setTimeToLiveSeconds(long ttl);
161
162 /***
163 * Accessor
164 */
165 boolean isOverflowToDisk();
166
167 /***
168 * setOverflowToDisk
169 *
170 * @param overflow
171 */
172 void setOverflowToDisk(boolean overflow);
173
174 /***
175 * Accessor
176 */
177 boolean isDiskPersistent();
178
179 /***
180 * setDiskPersistent
181 *
182 * @param diskPersistent
183 */
184 void setDiskPersistent(boolean diskPersistent);
185
186 /***
187 * Accessor
188 */
189 long getDiskExpiryThreadIntervalSeconds();
190
191 /***
192 * setDiskExpiryThreadIntervalSeconds
193 *
194 * @param seconds
195 */
196 void setDiskExpiryThreadIntervalSeconds(long seconds);
197
198 /***
199 * Accessor
200 */
201 int getDiskSpoolBufferSizeMB();
202
203 /***
204 * setDiskSpoolBufferSizeMB
205 *
206 * @param diskSpoolBufferSizeMB
207 */
208 void setDiskSpoolBufferSizeMB(int diskSpoolBufferSizeMB);
209
210 /***
211 * Accessor
212 */
213 boolean isTerracottaClustered();
214
215 /***
216 * Accessor
217 */
218 String getTerracottaConsistency();
219
220 /***
221 * Accessor
222 */
223 boolean isOverflowToOffHeap();
224
225 /***
226 * Accessor
227 *
228 * @deprecated use {@link #getMaxBytesLocalOffHeap()}
229 */
230 @Deprecated
231 long getMaxMemoryOffHeapInBytes();
232 }