use of org.infinispan.container.impl.AbstractDelegatingInternalDataContainer in project infinispan by infinispan.
the class ManualEvictionWithSizeBasedAndConcurrentOperationsInPrimaryOwnerTest method replaceControlledDataContainer.
private void replaceControlledDataContainer(final Latch latch) {
InternalDataContainer current = TestingUtil.extractComponent(cache, InternalDataContainer.class);
// noinspection unchecked
InternalDataContainer controlledDataContainer = new AbstractDelegatingInternalDataContainer() {
@Override
protected InternalDataContainer delegate() {
return current;
}
@Override
public void evict(Object key) {
latch.blockIfNeeded();
super.evict(key);
}
@Override
public CompletionStage<Void> evict(int segment, Object key) {
latch.blockIfNeeded();
return super.evict(segment, key);
}
};
TestingUtil.replaceComponent(cache, InternalDataContainer.class, controlledDataContainer, true);
}
Aggregations