1 /**
2  *  Copyright 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.statistics.sampled;
18
19 import net.sf.ehcache.Statistics;
20 import net.sf.ehcache.statistics.CacheUsageListener;
21
22 /**
23  * A no-op implementation of {@link SampledCacheStatistics}
24  * <p />
25  *
26  * @author <a href="mailto:asanoujam@terracottatech.com">Abhishek Sanoujam</a>
27  * @since 1.7
28  */

29 public class NullSampledCacheStatistics implements CacheUsageListener, SampledCacheStatistics {
30
31     /**
32      * {@inheritDoc}
33      */

34     public long getAverageGetTimeMostRecentSample() {
35         return 0;
36     }
37
38     /**
39      * {@inheritDoc}
40      */

41     public long getAverageGetTimeNanosMostRecentSample() {
42         return 0;
43     }
44
45     /**
46      * {@inheritDoc}
47      */

48     public long getCacheElementEvictedMostRecentSample() {
49         return 0;
50     }
51
52     /**
53      * {@inheritDoc}
54      */

55     public long getCacheElementExpiredMostRecentSample() {
56         return 0;
57     }
58
59     /**
60      * {@inheritDoc}
61      */

62     public long getCacheElementPutMostRecentSample() {
63         return 0;
64     }
65
66     /**
67      * {@inheritDoc}
68      */

69     public long getCacheElementRemovedMostRecentSample() {
70         return 0;
71     }
72
73     /**
74      * {@inheritDoc}
75      */

76     public long getCacheElementUpdatedMostRecentSample() {
77         return 0;
78     }
79
80     /**
81      * {@inheritDoc}
82      */

83     public long getCacheHitInMemoryMostRecentSample() {
84         return 0;
85     }
86
87     /**
88      * {@inheritDoc}
89      */

90     public long getCacheHitOffHeapMostRecentSample() {
91       return 0;
92     }
93
94     /**
95      * {@inheritDoc}
96      */

97     public long getCacheHitMostRecentSample() {
98         return 0;
99     }
100
101     /**
102      * {@inheritDoc}
103      */

104     public long getCacheHitOnDiskMostRecentSample() {
105         return 0;
106     }
107
108     /**
109      * {@inheritDoc}
110      */

111     public long getCacheMissExpiredMostRecentSample() {
112         return 0;
113     }
114
115     /**
116      * {@inheritDoc}
117      */

118     public long getCacheMissMostRecentSample() {
119         return 0;
120     }
121
122     /**
123      * {@inheritDoc}
124      */

125     public long getCacheMissInMemoryMostRecentSample() {
126         return 0;
127     }
128
129     /**
130      * {@inheritDoc}
131      */

132     public long getCacheMissOffHeapMostRecentSample() {
133         return 0;
134     }
135
136     /**
137      * {@inheritDoc}
138      */

139     public long getCacheMissOnDiskMostRecentSample() {
140         return 0;
141     }
142
143     /**
144      * {@inheritDoc}
145      */

146     public long getCacheMissNotFoundMostRecentSample() {
147         return 0;
148     }
149
150     /**
151      * {@inheritDoc}
152      */

153     public int getStatisticsAccuracy() {
154         return Statistics.STATISTICS_ACCURACY_NONE;
155     }
156
157     /**
158      * {@inheritDoc}
159      */

160     public String getStatisticsAccuracyDescription() {
161         return "None";
162     }
163
164     /**
165      * {@inheritDoc}
166      */

167     public boolean isSampledStatisticsEnabled() {
168         return false;
169     }
170
171     /**
172      * {@inheritDoc}
173      *
174      * @see net.sf.ehcache.statistics.sampled.SampledCacheStatistics#dispose()
175      */

176     public void dispose() {
177         // no-op
178     }
179
180     /**
181      * {@inheritDoc}
182      *
183      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyCacheElementEvicted()
184      */

185     public void notifyCacheElementEvicted() {
186         // no-op
187     }
188
189     /**
190      * {@inheritDoc}
191      *
192      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyCacheElementExpired()
193      */

194     public void notifyCacheElementExpired() {
195         // no-op
196     }
197
198     /**
199      * {@inheritDoc}
200      *
201      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyCacheElementPut()
202      */

203     public void notifyCacheElementPut() {
204         // no-op
205     }
206
207     /**
208      * {@inheritDoc}
209      *
210      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyCacheElementRemoved()
211      */

212     public void notifyCacheElementRemoved() {
213         // no-op
214     }
215
216     /**
217      * {@inheritDoc}
218      *
219      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyCacheElementUpdated()
220      */

221     public void notifyCacheElementUpdated() {
222         // no-op
223     }
224
225     /**
226      * {@inheritDoc}
227      *
228      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyCacheHitInMemory()
229      */

230     public void notifyCacheHitInMemory() {
231         // no-op
232     }
233
234     /**
235      * {@inheritDoc}
236      *
237      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyCacheHitOffHeap()
238      */

239     public void notifyCacheHitOffHeap() {
240         // no-op
241     }
242
243     /**
244      * {@inheritDoc}
245      *
246      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyCacheHitOnDisk()
247      */

248     public void notifyCacheHitOnDisk() {
249         // no-op
250     }
251
252     /**
253      * {@inheritDoc}
254      *
255      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyCacheMissedWithExpired()
256      */

257     public void notifyCacheMissedWithExpired() {
258         // no-op
259     }
260
261     /**
262      * {@inheritDoc}
263      *
264      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyCacheMissedWithNotFound()
265      */

266     public void notifyCacheMissedWithNotFound() {
267         // no-op
268     }
269
270     /**
271      * {@inheritDoc}
272      *
273      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyCacheMissInMemory()
274      */

275     public void notifyCacheMissInMemory() {
276         // no-op
277     }
278
279     /**
280      * {@inheritDoc}
281      *
282      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyCacheMissOffHeap()
283      */

284     public void notifyCacheMissOffHeap() {
285         // no-op
286     }
287
288     /**
289      * {@inheritDoc}
290      *
291      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyCacheMissOnDisk()
292      */

293     public void notifyCacheMissOnDisk() {
294         // no-op
295     }
296
297     /**
298      * {@inheritDoc}
299      *
300      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyRemoveAll()
301      */

302     public void notifyRemoveAll() {
303         // no-op
304     }
305
306     /**
307      * {@inheritDoc}
308      *
309      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyStatisticsAccuracyChanged(int)
310      */

311     public void notifyStatisticsAccuracyChanged(int statisticsAccuracy) {
312         // no-op
313     }
314
315     /**
316      * {@inheritDoc}
317      *
318      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyStatisticsCleared()
319      */

320     public void notifyStatisticsCleared() {
321         // no-op
322     }
323
324     /**
325      * {@inheritDoc}
326      *
327      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyStatisticsEnabledChanged(boolean)
328      */

329     public void notifyStatisticsEnabledChanged(boolean enableStatistics) {
330         // no-op
331     }
332
333     /**
334      * {@inheritDoc}
335      *
336      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyTimeTakenForGet(long)
337      */

338     public void notifyTimeTakenForGet(long millis) {
339         // no-op
340     }
341
342     /**
343      * {@inheritDoc}
344      *
345      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyGetTimeNanos(long)
346      */

347     public void notifyGetTimeNanos(long nanos) {
348         // no-op
349     }
350
351     /**
352      * {@inheritDoc}
353      *
354      * @see net.sf.ehcache.statistics.sampled.SampledCacheStatistics#clearStatistics()
355      */

356     public void clearStatistics() {
357         // no-op
358     }
359
360     /**
361      * {@inheritDoc}
362      */

363     public long getAverageSearchTime() {
364         return 0;
365     }
366
367     /**
368      * {@inheritDoc}
369      */

370     public long getSearchesPerSecond() {
371         return 0;
372     }
373
374     /**
375      * {@inheritDoc}
376      */

377     public void notifyCacheSearch(long executeTime) {
378         // no-op
379     }
380
381     /**
382      * {@inheritDoc}
383      */

384     public void notifyXaCommit() {
385         // no-op
386     }
387
388     /**
389      * {@inheritDoc}
390      */

391     public void notifyXaRollback() {
392         // no-op
393     }
394
395     /**
396      * {@inheritDoc}
397      */

398     public long getCacheXaCommitsMostRecentSample() {
399         return 0;
400     }
401
402     /**
403      * {@inheritDoc}
404      */

405     public long getCacheXaRollbacksMostRecentSample() {
406         return 0;
407     }
408
409     /**
410      * {@inheritDoc}
411      */

412     public int getCacheHitRatioMostRecentSample() {
413         return 0;
414     }
415 }
416