@Override public void insert(Cache.Key key, ByteArraySegment data) { insert(key, data.getCopy()); }
@Override public void remove(Cache.Key key) { super.remove(key); Consumer<CacheKey> callback = this.removeCallback; if (callback != null) { callback.accept((CacheKey) key); } } }
@Override public Cache getCache(String id) { synchronized (this.caches) { Exceptions.checkNotClosed(this.closed, this); return this.caches.computeIfAbsent(id, key -> new InMemoryCache(key, this::cacheClosed)); } }
@Override public void insert(Cache.Key key, byte[] payload) { super.insert(key, payload); Consumer<CacheKey> callback = this.insertCallback; if (callback != null) { callback.accept((CacheKey) key); } }