|
| 1 | +package com.baeldung.hazelcast.listener; |
| 2 | + |
| 3 | +import org.slf4j.Logger; |
| 4 | +import org.slf4j.LoggerFactory; |
| 5 | + |
| 6 | +import com.hazelcast.core.EntryEvent; |
| 7 | +import com.hazelcast.core.MapEvent; |
| 8 | +import com.hazelcast.map.listener.EntryAddedListener; |
| 9 | +import com.hazelcast.map.listener.EntryEvictedListener; |
| 10 | +import com.hazelcast.map.listener.EntryRemovedListener; |
| 11 | +import com.hazelcast.map.listener.EntryUpdatedListener; |
| 12 | +import com.hazelcast.map.listener.MapClearedListener; |
| 13 | +import com.hazelcast.map.listener.MapEvictedListener; |
| 14 | + |
| 15 | +public class CountryEntryListener implements EntryAddedListener<Long, String>, EntryRemovedListener<Long, String>, EntryUpdatedListener<Long, String>, EntryEvictedListener<Long, String>, MapEvictedListener, MapClearedListener { |
| 16 | + private static final Logger logger = LoggerFactory.getLogger(CountryEntryListener.class); |
| 17 | + |
| 18 | + public void entryAdded(EntryEvent<Long, String> event) { |
| 19 | + logger.info("entryAdded:" + event); |
| 20 | + } |
| 21 | + |
| 22 | + public void entryUpdated(EntryEvent<Long, String> event) { |
| 23 | + logger.info("entryUpdated:" + event); |
| 24 | + } |
| 25 | + |
| 26 | + public void entryRemoved(EntryEvent<Long, String> event) { |
| 27 | + logger.info("entryRemoved:" + event); |
| 28 | + } |
| 29 | + |
| 30 | + public void entryEvicted(EntryEvent<Long, String> event) { |
| 31 | + logger.info("entryEvicted:" + event); |
| 32 | + } |
| 33 | + |
| 34 | + public void mapCleared(MapEvent event) { |
| 35 | + logger.info("mapCleared:" + event); |
| 36 | + } |
| 37 | + |
| 38 | + public void mapEvicted(MapEvent event) { |
| 39 | + logger.info("mapEvicted:" + event); |
| 40 | + } |
| 41 | +} |
0 commit comments