if (cfg.async().enabled() && writer != null) {
writer = createAsyncWriter(writer);
if (loader != null) {
AtomicReference<State> state = ((AsyncCacheWriter) writer).getState();
loader = (loader instanceof AdvancedCacheLoader) ?
new AdvancedAsyncCacheLoader(loader, state) : new AsyncCacheLoader(loader, state);
}
}
InitializationContextImpl ctx = new InitializationContextImpl(cfg, cache, m, timeService, byteBufferFactory,
marshalledEntryFactory);