Java 类com.hazelcast.core.EntryAdapter 实例源码

项目:spring-boot-admin    文件:HazelcastEventStore.java   
public HazelcastEventStore(int maxLogSizePerAggregate, IMap<InstanceId, List<InstanceEvent>> eventLog) {
    super(maxLogSizePerAggregate, eventLog);

    eventLog.addEntryListener((MapListener) new EntryAdapter<InstanceId, List<InstanceEvent>>() {
        @Override
        public void entryUpdated(EntryEvent<InstanceId, List<InstanceEvent>> event) {
            log.debug("Updated {}", event);
            long lastKnownVersion = getLastVersion(event.getOldValue());
            List<InstanceEvent> newEvents = event.getValue()
                                                 .stream()
                                                 .filter(e -> e.getVersion() > lastKnownVersion)
                                                 .collect(Collectors.toList());
            HazelcastEventStore.this.publish(newEvents);
        }
    }, true);
}