use of javax.cache.event.CacheEntryRemovedListener in project cache2k by cache2k.
the class CacheEntryListenerServer method runHandlers.
private void runHandlers(EventType eventType, TestCacheEntryEvent event) {
ArrayList events = new ArrayList(1);
events.add(event);
for (CacheEntryListener listener : listeners) {
switch(eventType) {
case CREATED:
if (listener instanceof CacheEntryCreatedListener) {
((CacheEntryCreatedListener) listener).onCreated(events);
}
break;
case UPDATED:
if (listener instanceof CacheEntryUpdatedListener) {
((CacheEntryUpdatedListener) listener).onUpdated(events);
}
break;
case REMOVED:
if (listener instanceof CacheEntryRemovedListener) {
((CacheEntryRemovedListener) listener).onRemoved(events);
}
break;
case EXPIRED:
if (listener instanceof CacheEntryExpiredListener) {
((CacheEntryExpiredListener) listener).onExpired(events);
}
break;
default:
break;
}
}
}
Aggregations