~ubuntu-branches/ubuntu/oneiric/ehcache/oneiric

« back to all changes in this revision

Viewing changes to src/main/java/net/sf/ehcache/management/sampled/SampledCacheMBean.java

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2010-06-23 10:35:31 UTC
  • mfrom: (1.1.5 upstream) (2.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100623103531-ra0qdpmotoz6ygct
Tags: 2.1.0-1
Merge changes from Thierry's PPA and upload to Debian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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.sampled;
 
18
 
 
19
import net.sf.ehcache.statistics.LiveCacheStatistics;
 
20
import net.sf.ehcache.statistics.sampled.SampledCacheStatistics;
 
21
 
 
22
/**
 
23
 * An MBean for Cache exposing cache statistics.
 
24
 * Extends from both {@link LiveCacheStatistics} and {@link SampledCacheStatistics}
 
25
 * 
 
26
 * <p />
 
27
 * 
 
28
 * @author <a href="mailto:asanoujam@terracottatech.com">Abhishek Sanoujam</a>
 
29
 * @since 1.7
 
30
 */
 
31
public interface SampledCacheMBean extends LiveCacheStatistics, SampledCacheStatistics {
 
32
    /**
 
33
     * CACHE_ENABLED
 
34
     */
 
35
    public static final String CACHE_ENABLED = "CacheEnabled";
 
36
    
 
37
    /**
 
38
     * CACHE_CHANGED
 
39
     */
 
40
    public static final String CACHE_CHANGED = "CacheChanged";
 
41
    
 
42
    /**
 
43
     * CACHE_FLUSHED
 
44
     */
 
45
    public static final String CACHE_FLUSHED = "CacheFlushed";
 
46
    
 
47
    /**
 
48
     * CACHE_CLEARED
 
49
     */
 
50
    public static final String CACHE_CLEARED = "CacheCleared";
 
51
    
 
52
    /**
 
53
     * CACHE_STATISTICS_ENABLED
 
54
     */
 
55
    public static final String CACHE_STATISTICS_ENABLED = "CacheStatisticsEnabled";
 
56
    
 
57
    /**
 
58
     * CACHE_STATISTICS_RESET
 
59
     */
 
60
    public static final String CACHE_STATISTICS_RESET = "CacheStatisticsReset";
 
61
 
 
62
    /**
 
63
     * Is the cache enabled?
 
64
     */
 
65
    boolean isEnabled();
 
66
    
 
67
    /**
 
68
     * Enabled/disable cache coherence mode for this node.
 
69
     */
 
70
    void setNodeCoherent(boolean coherent);
 
71
    
 
72
    /**
 
73
     * Is the cache coherent cluster-wide?
 
74
     */
 
75
    boolean isClusterCoherent();
 
76
 
 
77
    /**
 
78
     * Is the cache coherent locally?
 
79
     */
 
80
    boolean isNodeCoherent();
 
81
    
 
82
    /**
 
83
     * Enabled/disable the cache.
 
84
     */
 
85
    void setEnabled(boolean enabled);
 
86
    
 
87
    /**
 
88
     * Removes all cached items.
 
89
     */
 
90
    void removeAll();
 
91
 
 
92
    /**
 
93
     * Flushes all cache items from memory to the disk store, and from the
 
94
     * DiskStore to disk.
 
95
     */
 
96
    void flush();
 
97
 
 
98
    /**
 
99
     * Gets the status attribute of the Cache.
 
100
     * 
 
101
     * @return The status value from the Status enum class
 
102
     */
 
103
    String getStatus();
 
104
 
 
105
    /**
 
106
     * Is the cache configured with Terracotta clustering?
 
107
     * 
 
108
     * @return true if clustered with terracotta
 
109
     */
 
110
    public boolean isTerracottaClustered();
 
111
 
 
112
    /**
 
113
     * Clear both sampled and cumulative statistics
 
114
     */
 
115
    public void clearStatistics();
 
116
 
 
117
    /**
 
118
     * Enables statistics collection
 
119
     */
 
120
    public void enableStatistics();
 
121
 
 
122
    /**
 
123
     * Disables statistics collection. Also disables sampled statistics if it is
 
124
     * enabled.
 
125
     */
 
126
    public void disableStatistics();
 
127
 
 
128
    /**
 
129
     * Controls the statistics. Also controls sampled statistics if it is
 
130
     * enabled.
 
131
     */
 
132
    public void setStatisticsEnabled(boolean statsEnabled);
 
133
    
 
134
    /**
 
135
     * Enables statistics collection. As it requires that normal statistics
 
136
     * collection to be enabled, it enables it if its not already
 
137
     */
 
138
    public void enableSampledStatistics();
 
139
 
 
140
    /**
 
141
     * Disables statistics collection
 
142
     */
 
143
    public void disableSampledStatistics();
 
144
 
 
145
    /**
 
146
     * Configuration property accessor
 
147
     * 
 
148
     * @return Max elements in memory config setting value
 
149
     */
 
150
    public int getConfigMaxElementsInMemory();
 
151
 
 
152
    /**
 
153
     * setConfigMaxElementsInMemory
 
154
     * @param maxElements
 
155
     */
 
156
    public void setConfigMaxElementsInMemory(int maxElements);
 
157
    
 
158
    /**
 
159
     * Configuration property accessor
 
160
     * 
 
161
     * @return Max elements on disk config setting value
 
162
     */
 
163
    public int getConfigMaxElementsOnDisk();
 
164
 
 
165
    /**
 
166
     * setConfigMaxElementsOnDisk
 
167
     * @param maxElements
 
168
     */
 
169
    public void setConfigMaxElementsOnDisk(int maxElements);
 
170
    
 
171
    /**
 
172
     * Configuration property accessor
 
173
     * 
 
174
     * @return a String representation of the policy
 
175
     */
 
176
    public String getConfigMemoryStoreEvictionPolicy();
 
177
 
 
178
    /**
 
179
     * setConfigMemoryStoreEvictionPolicy
 
180
     * @param evictionPolicy
 
181
     */
 
182
    public void setConfigMemoryStoreEvictionPolicy(String evictionPolicy);
 
183
 
 
184
    /**
 
185
     * Configuration property accessor
 
186
     * 
 
187
     * @return true if set to eternal in config
 
188
     */
 
189
    public boolean isConfigEternal();
 
190
 
 
191
    /**
 
192
     * setConfigEternal
 
193
     * @param eternal
 
194
     */
 
195
    public void setConfigEternal(boolean eternal);
 
196
    
 
197
    /**
 
198
     * Configuration property accessor
 
199
     * 
 
200
     * @return TTI in config
 
201
     */
 
202
    public long getConfigTimeToIdleSeconds();
 
203
 
 
204
    /**
 
205
     * setConfigTimeToIdleSeconds
 
206
     * @param tti
 
207
     */
 
208
    public void setConfigTimeToIdleSeconds(long tti);
 
209
    
 
210
    /**
 
211
     * Configuration property accessor
 
212
     * 
 
213
     * @return TTL in config
 
214
     */
 
215
    public long getConfigTimeToLiveSeconds();
 
216
 
 
217
    /**
 
218
     * setConfigTimeToLiveSeconds
 
219
     * @param ttl
 
220
     */
 
221
    public void setConfigTimeToLiveSeconds(long ttl);
 
222
    
 
223
    /**
 
224
     * Configuration property accessor
 
225
     * 
 
226
     * @return true if overflow to disk specified in config
 
227
     */
 
228
    public boolean isConfigOverflowToDisk();
 
229
 
 
230
    /**
 
231
     * setConfigOverflowToDisk
 
232
     * @param overflowToDisk
 
233
     */
 
234
    public void setConfigOverflowToDisk(boolean overflowToDisk);
 
235
    
 
236
    /**
 
237
     * Configuration property accessor
 
238
     * 
 
239
     * @return true if configured with disk persistence
 
240
     */
 
241
    public boolean isConfigDiskPersistent();
 
242
 
 
243
    /**
 
244
     * setConfigDiskPersistent
 
245
     * @param diskPersistent
 
246
     */
 
247
    public void setConfigDiskPersistent(boolean diskPersistent);
 
248
    
 
249
    /**
 
250
     * Configuration property accessor
 
251
     * 
 
252
     * @return Value for disk expiry thread interval in seconds specified in config
 
253
     */
 
254
    public long getConfigDiskExpiryThreadIntervalSeconds();
 
255
 
 
256
    /**
 
257
     * setConfigDiskExpiryThreadIntervalSeconds
 
258
     * @param seconds
 
259
     */
 
260
    public void setConfigDiskExpiryThreadIntervalSeconds(long seconds);
 
261
 
 
262
    /**
 
263
     * Configuration property accessor
 
264
     * 
 
265
     * @return true if logging is enabled on the cache
 
266
     */
 
267
    public boolean isConfigLoggingEnabled();
 
268
 
 
269
    /**
 
270
     * setConfigLoggingEnabled
 
271
     * @param enabled
 
272
     */
 
273
    public void setConfigLoggingEnabled(boolean enabled);
 
274
}