use of org.n52.iceland.cache.ctrl.persistence.ImmediatePersistenceStrategy in project SOS by 52North.
the class TestableInMemoryCacheController method setUp.
public static void setUp() {
directory = Files.createTempDir();
tempFile = new File(directory, "cache.tmp");
ImmediatePersistenceStrategy ps = new ImmediatePersistenceStrategy();
ps.setConfigLocationProvider(directory::getAbsolutePath);
ps.init();
}
use of org.n52.iceland.cache.ctrl.persistence.ImmediatePersistenceStrategy in project SOS by 52North.
the class ContentCacheControllerImplTest method createController.
private ContentCacheControllerImpl createController() throws ConfigurationError {
ImmediatePersistenceStrategy persistenceStrategy = new ImmediatePersistenceStrategy();
persistenceStrategy.setConfigLocationProvider(tempFolder.getRoot()::getAbsolutePath);
persistenceStrategy.init();
CompleteCacheUpdateFactoryImpl cacheUpdateFactory = new CompleteCacheUpdateFactoryImpl();
CacheFeederHandler cacheFeederHandler = new NoOpCacheFeederHandler();
cacheUpdateFactory.setCacheFeederHandler(cacheFeederHandler);
ContentCacheFactory cacheFactory = InMemoryCacheImpl::new;
ContentCacheControllerImpl ccc = new ContentCacheControllerImpl();
ccc.setCacheFactory(cacheFactory);
ccc.setPersistenceStrategy(persistenceStrategy);
ccc.setCompleteCacheUpdateFactory(cacheUpdateFactory);
ccc.setUpdateInterval(0);
ccc.init();
return ccc;
}
Aggregations