1 5 package com.opensymphony.oscache.extra; 6 7 import com.opensymphony.oscache.base.events.*; 8 9 21 public class CacheEntryEventListenerImpl implements CacheEntryEventListener { 22 25 private int cacheFlushedCount = 0; 26 27 30 private int entryAddedCount = 0; 31 32 35 private int entryFlushedCount = 0; 36 37 40 private int entryRemovedCount = 0; 41 42 45 private int entryUpdatedCount = 0; 46 47 50 private int groupFlushedCount = 0; 51 52 55 private int patternFlushedCount = 0; 56 57 60 public CacheEntryEventListenerImpl() { 61 } 62 63 68 public int getEntryAddedCount() { 69 return entryAddedCount; 70 } 71 72 77 public int getEntryFlushedCount() { 78 return entryFlushedCount; 79 } 80 81 86 public int getEntryRemovedCount() { 87 return entryRemovedCount; 88 } 89 90 95 public int getEntryUpdatedCount() { 96 return entryUpdatedCount; 97 } 98 99 104 public int getGroupFlushedCount() { 105 return groupFlushedCount; 106 } 107 108 113 public int getPatternFlushedCount() { 114 return patternFlushedCount; 115 } 116 117 122 public int getCacheFlushedCount() { 123 return cacheFlushedCount; 124 } 125 126 131 public void cacheEntryAdded(CacheEntryEvent event) { 132 entryAddedCount++; 133 } 134 135 140 public void cacheEntryFlushed(CacheEntryEvent event) { 141 entryFlushedCount++; 142 } 143 144 149 public void cacheEntryRemoved(CacheEntryEvent event) { 150 entryRemovedCount++; 151 } 152 153 158 public void cacheEntryUpdated(CacheEntryEvent event) { 159 entryUpdatedCount++; 160 } 161 162 167 public void cacheGroupFlushed(CacheGroupEvent event) { 168 groupFlushedCount++; 169 } 170 171 176 public void cachePatternFlushed(CachePatternEvent event) { 177 patternFlushedCount++; 178 } 179 180 185 public void cacheFlushed(CachewideEvent event) { 186 cacheFlushedCount++; 187 } 188 189 192 public String toString() { 193 return ("Added " + entryAddedCount + ", Updated " + entryUpdatedCount + ", Flushed " + entryFlushedCount + ", Removed " + entryRemovedCount + ", Groups Flushed " + groupFlushedCount + ", Patterns Flushed " + patternFlushedCount + ", Cache Flushed " + cacheFlushedCount); 194 } 195 } 196 | Popular Tags |