private AdvancedAsyncCacheWriter writer;
private AdvancedAsyncCacheLoader loader;
private TestObjectStreamMarshaller testObjectStreamMarshaller;
private void createStore() throws PersistenceException {
DummyInMemoryStoreConfigurationBuilder dummyCfg = TestCacheManagerFactory.getDefaultCacheConfiguration(false)
.persistence()
.addStore(DummyInMemoryStoreConfigurationBuilder.class)
.storeName(AsyncStoreTest.class.getName());
dummyCfg
.async()
.enable()
.threadPoolSize(10);
DummyInMemoryStore underlying = new DummyInMemoryStore();
writer = new AdvancedAsyncCacheWriter(underlying);
TestObjectStreamMarshaller ma = new TestObjectStreamMarshaller();
DummyInitializationContext ctx = new DummyInitializationContext(dummyCfg.create(), getCache(), ma, new ByteBufferFactoryImpl(), new MarshalledEntryFactoryImpl(ma));
writer.init(ctx);
writer.start();
loader = new AdvancedAsyncCacheLoader(underlying, writer.getState());
loader.init(ctx);
loader.start();