View Javadoc

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.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 getCacheElementEvictedMostRecentSample() {
42          return 0;
43      }
44  
45      /***
46       * {@inheritDoc}
47       */
48      public long getCacheElementExpiredMostRecentSample() {
49          return 0;
50      }
51  
52      /***
53       * {@inheritDoc}
54       */
55      public long getCacheElementPutMostRecentSample() {
56          return 0;
57      }
58  
59      /***
60       * {@inheritDoc}
61       */
62      public long getCacheElementRemovedMostRecentSample() {
63          return 0;
64      }
65  
66      /***
67       * {@inheritDoc}
68       */
69      public long getCacheElementUpdatedMostRecentSample() {
70          return 0;
71      }
72  
73      /***
74       * {@inheritDoc}
75       */
76      public long getCacheHitInMemoryMostRecentSample() {
77          return 0;
78      }
79  
80      /***
81       * {@inheritDoc}
82       */
83      public long getCacheHitOffHeapMostRecentSample() {
84        return 0;
85      }
86  
87      /***
88       * {@inheritDoc}
89       */
90      public long getCacheHitMostRecentSample() {
91          return 0;
92      }
93  
94      /***
95       * {@inheritDoc}
96       */
97      public long getCacheHitOnDiskMostRecentSample() {
98          return 0;
99      }
100 
101     /***
102      * {@inheritDoc}
103      */
104     public long getCacheMissExpiredMostRecentSample() {
105         return 0;
106     }
107 
108     /***
109      * {@inheritDoc}
110      */
111     public long getCacheMissMostRecentSample() {
112         return 0;
113     }
114 
115     /***
116      * {@inheritDoc}
117      */
118     public long getCacheMissInMemoryMostRecentSample() {
119         return 0;
120     }
121 
122     /***
123      * {@inheritDoc}
124      */
125     public long getCacheMissOffHeapMostRecentSample() {
126         return 0;
127     }
128 
129     /***
130      * {@inheritDoc}
131      */
132     public long getCacheMissOnDiskMostRecentSample() {
133         return 0;
134     }
135 
136     /***
137      * {@inheritDoc}
138      */
139     public long getCacheMissNotFoundMostRecentSample() {
140         return 0;
141     }
142 
143     /***
144      * {@inheritDoc}
145      */
146     public int getStatisticsAccuracy() {
147         return Statistics.STATISTICS_ACCURACY_NONE;
148     }
149 
150     /***
151      * {@inheritDoc}
152      */
153     public String getStatisticsAccuracyDescription() {
154         return "None";
155     }
156 
157     /***
158      * {@inheritDoc}
159      */
160     public boolean isSampledStatisticsEnabled() {
161         return false;
162     }
163 
164     /***
165      * {@inheritDoc}
166      *
167      * @see net.sf.ehcache.statistics.sampled.SampledCacheStatistics#dispose()
168      */
169     public void dispose() {
170         // no-op
171     }
172 
173     /***
174      * {@inheritDoc}
175      *
176      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyCacheElementEvicted()
177      */
178     public void notifyCacheElementEvicted() {
179         // no-op
180     }
181 
182     /***
183      * {@inheritDoc}
184      *
185      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyCacheElementExpired()
186      */
187     public void notifyCacheElementExpired() {
188         // no-op
189     }
190 
191     /***
192      * {@inheritDoc}
193      *
194      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyCacheElementPut()
195      */
196     public void notifyCacheElementPut() {
197         // no-op
198     }
199 
200     /***
201      * {@inheritDoc}
202      *
203      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyCacheElementRemoved()
204      */
205     public void notifyCacheElementRemoved() {
206         // no-op
207     }
208 
209     /***
210      * {@inheritDoc}
211      *
212      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyCacheElementUpdated()
213      */
214     public void notifyCacheElementUpdated() {
215         // no-op
216     }
217 
218     /***
219      * {@inheritDoc}
220      *
221      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyCacheHitInMemory()
222      */
223     public void notifyCacheHitInMemory() {
224         // no-op
225     }
226 
227     /***
228      * {@inheritDoc}
229      *
230      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyCacheHitOffHeap()
231      */
232     public void notifyCacheHitOffHeap() {
233         // no-op
234     }
235 
236     /***
237      * {@inheritDoc}
238      *
239      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyCacheHitOnDisk()
240      */
241     public void notifyCacheHitOnDisk() {
242         // no-op
243     }
244 
245     /***
246      * {@inheritDoc}
247      *
248      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyCacheMissedWithExpired()
249      */
250     public void notifyCacheMissedWithExpired() {
251         // no-op
252     }
253 
254     /***
255      * {@inheritDoc}
256      *
257      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyCacheMissedWithNotFound()
258      */
259     public void notifyCacheMissedWithNotFound() {
260         // no-op
261     }
262 
263     /***
264      * {@inheritDoc}
265      *
266      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyCacheMissInMemory()
267      */
268     public void notifyCacheMissInMemory() {
269         // no-op
270     }
271 
272     /***
273      * {@inheritDoc}
274      *
275      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyCacheMissOffHeap()
276      */
277     public void notifyCacheMissOffHeap() {
278         // no-op
279     }
280 
281     /***
282      * {@inheritDoc}
283      *
284      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyCacheMissOnDisk()
285      */
286     public void notifyCacheMissOnDisk() {
287         // no-op
288     }
289 
290     /***
291      * {@inheritDoc}
292      *
293      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyRemoveAll()
294      */
295     public void notifyRemoveAll() {
296         // no-op
297     }
298 
299     /***
300      * {@inheritDoc}
301      *
302      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyStatisticsAccuracyChanged(int)
303      */
304     public void notifyStatisticsAccuracyChanged(int statisticsAccuracy) {
305         // no-op
306     }
307 
308     /***
309      * {@inheritDoc}
310      *
311      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyStatisticsCleared()
312      */
313     public void notifyStatisticsCleared() {
314         // no-op
315     }
316 
317     /***
318      * {@inheritDoc}
319      *
320      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyStatisticsEnabledChanged(boolean)
321      */
322     public void notifyStatisticsEnabledChanged(boolean enableStatistics) {
323         // no-op
324     }
325 
326     /***
327      * {@inheritDoc}
328      *
329      * @see net.sf.ehcache.statistics.CacheUsageListener#notifyTimeTakenForGet(long)
330      */
331     public void notifyTimeTakenForGet(long millis) {
332         // no-op
333     }
334 
335     /***
336      * {@inheritDoc}
337      *
338      * @see net.sf.ehcache.statistics.sampled.SampledCacheStatistics#clearStatistics()
339      */
340     public void clearStatistics() {
341         // no-op
342 
343     }
344 
345     /***
346      * {@inheritDoc}
347      */
348     public long getAverageSearchTime() {
349         return 0;
350     }
351 
352     /***
353      * {@inheritDoc}
354      */
355     public long getSearchesPerSecond() {
356         return 0;
357     }
358 
359     /***
360      * {@inheritDoc}
361      */
362     public void notifyCacheSearch(long executeTime) {
363         // no-op
364     }
365 
366     /***
367      * {@inheritDoc}
368      */
369     public void notifyXaCommit() {
370         // no-op
371     }
372 
373     /***
374      * {@inheritDoc}
375      */
376     public void notifyXaRollback() {
377         // no-op
378     }
379 
380     /***
381      * {@inheritDoc}
382      */
383     public long getCacheXaCommitsMostRecentSample() {
384         return 0;
385     }
386 
387     /***
388      * {@inheritDoc}
389      */
390     public long getCacheXaRollbacksMostRecentSample() {
391         return 0;
392     }
393 }