}
@Override
public void dispatchEvent(Object event, Object listener) {
if (event instanceof EntryEvent) {
EntryEvent entryEvent = (EntryEvent) event;
EntryListener entryListener = (EntryListener) listener;
switch (entryEvent.getEventType()) {
case ADDED:
entryListener.entryAdded(entryEvent);
break;
case EVICTED:
entryListener.entryEvicted(entryEvent);
break;
case UPDATED:
entryListener.entryUpdated(entryEvent);
break;
case REMOVED:
entryListener.entryRemoved(entryEvent);
break;
// TODO handle evictAll and clearAll event
default:
throw new IllegalArgumentException("event type " + entryEvent.getEventType() + " not supported");
}
String mapName = ((EntryEvent) event).getName();
if (config.findReplicatedMapConfig(mapName).isStatisticsEnabled()) {
ReplicatedRecordStore recordStore = replicatedStorages.get(mapName);
if (recordStore instanceof AbstractReplicatedRecordStore) {