@Test public void testPassesWrappedWriterToAsyncCoordinatorOnStart() { final CacheWriter writer = mock(CacheWriter.class); asyncWriteBehind.start(writer); ArgumentCaptor<CacheWriterProcessor> captor = ArgumentCaptor.forClass(CacheWriterProcessor.class); verify(asyncCoordinator).start(captor.capture(), eq(CONCURRENCY), same(AsyncWriteBehind.POLICY)); assertThat(captor.getAllValues().size(), is(1)); assertThat(captor.getValue().getCacheWriter(), sameInstance(writer)); }
@Override public void start(CacheWriter writer) throws CacheException { async.start(new CacheWriterProcessor(writer), concurrency, POLICY); }
AsyncWriteBehind implements WriteBehind { @Override public void start(CacheWriter writer) throws CacheException { async.start(new CacheWriterProcessor(writer), concurrency, POLICY); } }
AsyncWriteBehind implements WriteBehind { @Override public void start(CacheWriter writer) throws CacheException { async.start(new CacheWriterProcessor(writer), concurrency, POLICY); } AsyncWriteBehind(final AsyncCoordinator async, final int writeBehindConcurrency); }
AsyncWriteBehind implements WriteBehind { @Override public void start(CacheWriter writer) throws CacheException { async.start(new CacheWriterProcessor(writer), concurrency, POLICY); } AsyncWriteBehind(final AsyncCoordinator async, final int writeBehindConcurrency); @Override void start(CacheWriter writer); @Override void write(Element element); @Override void delete(CacheEntry entry); @Override void setOperationsFilter(OperationsFilter filter); @Override void stop(); @Override long getQueueSize(); }
AsyncWriteBehind implements WriteBehind { @Override public void start(CacheWriter writer) throws CacheException { async.start(new CacheWriterProcessor(writer), concurrency, POLICY); } AsyncWriteBehind(final AsyncCoordinator async, final int writeBehindConcurrency); @Override void start(CacheWriter writer); @Override void write(Element element); @Override void delete(CacheEntry entry); @Override void setOperationsFilter(OperationsFilter filter); @Override void stop(); @Override long getQueueSize(); static final ItemScatterPolicy<SingleAsyncOperation> POLICY; }