use of org.cache2k.event.CacheClosedListener in project cache2k by cache2k.
the class Cache2kBuilderTest method cacheClosedEventFired.
private void cacheClosedEventFired(boolean _wiredCache) {
final AtomicBoolean _FIRED = new AtomicBoolean();
Cache2kBuilder _builder = Cache2kBuilder.forUnknownTypes();
_builder.addCacheClosedListener(new CacheClosedListener() {
@Override
public void onCacheClosed(final Cache cache) {
_FIRED.set(true);
}
});
if (_wiredCache) {
StaticUtil.enforceWiredCache(_builder);
}
Cache c = _builder.build();
c.close();
assertTrue(_FIRED.get());
}
Aggregations