com.hazelcast.map.listener.EntryUpdatedListener Java Examples

The following examples show how to use com.hazelcast.map.listener.EntryUpdatedListener. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CryptoSentimentGui.java    From hazelcast-jet-demos with Apache License 2.0 6 votes vote down vote up
public CryptoSentimentGui(
        IMap<Tuple2<CoinType, WinSize>, Tuple2<Double, Long>> jetResults
) {
    for (WinSize winSize : WinSize.values()) {
        for (CoinType coinType : CoinType.values()) {
            sentimentDataset.addValue(0.0, coinType, winSize);
            mentionsDataset.addValue(0.0, coinType, winSize);
        }
    }

    jetResults.addEntryListener(
            (EntryAddedListener<Tuple2<CoinType, WinSize>, Tuple2<Double, Long>>) this::onMapEvent, true);
    jetResults.addEntryListener(
            (EntryUpdatedListener<Tuple2<CoinType, WinSize>, Tuple2<Double, Long>>) this::onMapEvent, true);
    EventQueue.invokeLater(this::startGui);
}
 
Example #2
Source File: ClientManager.java    From openmeetings with Apache License 2.0 6 votes vote down vote up
void init() {
	log.debug("Cluster:: PostConstruct");
	onlineClients.putAll(map());
	onlineRooms.putAll(rooms());
	onlineServers.putAll(servers());
	map().addEntryListener(new ClientListener(), true);
	rooms().addEntryListener(new RoomListener(), true);
	servers().addEntryListener(new EntryUpdatedListener<String, ServerInfo>() {

		@Override
		public void entryUpdated(EntryEvent<String, ServerInfo> event) {
			log.debug("Cluster:: Server was updated {} -> {}", event.getKey(), event.getValue());
			onlineServers.put(event.getKey(), event.getValue());
		}
	}, true);
}
 
Example #3
Source File: HazelcastClusterMap.java    From dew with Apache License 2.0 4 votes vote down vote up
@Override
public HazelcastClusterMap<M> regEntryUpdatedEvent(Consumer<EntryEvent<M>> fun) {
    map.addEntryListener((EntryUpdatedListener<String, M>) entryEvent -> packageEntryEvent(fun, entryEvent), true);
    return this;
}