final int maxEntries = getMaxEntries();
final AtomicInteger loadedEntries = new AtomicInteger(0);
final AdvancedCache<Object, Object> flaggedCache = getCacheForStateInsertion();
preloadCl.process(null, new AdvancedCacheLoader.CacheLoaderTask() {
@Override
public void processEntry(MarshalledEntry me, AdvancedCacheLoader.TaskContext taskContext) throws InterruptedException {
if (loadedEntries.getAndIncrement() >= maxEntries) {
taskContext.stop();
return;