@Configurable public class AsyncCachePersistenceStrategy extends AbstractPersistingCachePersistenceStrategy
Modifier and Type | Class and Description |
---|---|
private class |
AsyncCachePersistenceStrategy.Updater |
Modifier and Type | Field and Description |
---|---|
private AtomicReference<ContentCache> |
cacheReference |
private ScheduledExecutorService |
executor |
private static org.slf4j.Logger |
LOGGER |
private AsyncCachePersistenceStrategy.Updater |
updater |
private static TimeUnit |
WRITE_DELAY_UNITS |
private long |
writeDelay |
Constructor and Description |
---|
AsyncCachePersistenceStrategy() |
AsyncCachePersistenceStrategy(File cacheFile) |
Modifier and Type | Method and Description |
---|---|
void |
persistOnCompleteUpdate(ContentCache cache)
Persist the specified cache in the event of a complete content update.
|
void |
persistOnPartialUpdate(ContentCache cache)
Persist the specified cache in the event of a partial content update.
|
void |
persistOnShutdown(ContentCache cache)
Persist the specified cache in the event of a service shutdown.
|
void |
setDelay(int delay) |
cleanup, getCacheFile, load, persistCache
private static final org.slf4j.Logger LOGGER
private static final TimeUnit WRITE_DELAY_UNITS
private long writeDelay
private final ScheduledExecutorService executor
private final AtomicReference<ContentCache> cacheReference
private AsyncCachePersistenceStrategy.Updater updater
public AsyncCachePersistenceStrategy()
public AsyncCachePersistenceStrategy(File cacheFile)
public void persistOnPartialUpdate(ContentCache cache)
ContentCachePersistenceStrategy
cache
- the cachepublic void persistOnCompleteUpdate(ContentCache cache)
ContentCachePersistenceStrategy
cache
- the cachepublic void persistOnShutdown(ContentCache cache)
ContentCachePersistenceStrategy
cache
- the cacheCopyright © 2012-2015 52north.org. All Rights Reserved.