in jetcache-core/src/main/java/com/alicp/jetcache/support/BroadcastManager.java [85:109]
private void processCacheMessage(CacheMessage cacheMessage) {
if (sourceId.equals(cacheMessage.getSourceId())) {
return;
}
Cache cache = cacheManager.getCache(cacheMessage.getArea(), cacheMessage.getCacheName());
if (cache == null) {
logger.warn("Cache instance not exists: {},{}", cacheMessage.getArea(), cacheMessage.getCacheName());
return;
}
Cache absCache = CacheUtil.getAbstractCache(cache);
if (!(absCache instanceof MultiLevelCache)) {
logger.warn("Cache instance is not MultiLevelCache: {},{}", cacheMessage.getArea(), cacheMessage.getCacheName());
return;
}
Cache[] caches = ((MultiLevelCache) absCache).caches();
Set<Object> keys = Stream.of(cacheMessage.getKeys()).collect(Collectors.toSet());
for (Cache c : caches) {
Cache localCache = CacheUtil.getAbstractCache(c);
if (localCache instanceof AbstractEmbeddedCache) {
((AbstractEmbeddedCache) localCache).__removeAll(keys);
} else {
break;
}
}
}