use of com.github.benmanes.caffeine.jcache.configuration.CaffeineConfiguration in project caffeine by ben-manes.
the class JCacheAccessExpiryTest method getConfiguration.
@Override
protected CaffeineConfiguration<Integer, Integer> getConfiguration() {
CaffeineConfiguration<Integer, Integer> configuration = new CaffeineConfiguration<>();
configuration.setExpiryPolicyFactory(() -> new AccessedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS, EXPIRY_DURATION)));
configuration.setTickerFactory(() -> ticker::read);
return configuration;
}
use of com.github.benmanes.caffeine.jcache.configuration.CaffeineConfiguration in project caffeine by ben-manes.
the class JCacheUpdateExpiryTest method getConfiguration.
@Override
protected CaffeineConfiguration<Integer, Integer> getConfiguration() {
CaffeineConfiguration<Integer, Integer> configuration = new CaffeineConfiguration<>();
configuration.setExpiryPolicyFactory(() -> new ModifiedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS, EXPIRY_DURATION)));
configuration.setTickerFactory(() -> ticker::read);
return configuration;
}
use of com.github.benmanes.caffeine.jcache.configuration.CaffeineConfiguration in project caffeine by ben-manes.
the class JCacheCreationExpiryTest method getConfiguration.
@Override
protected CaffeineConfiguration<Integer, Integer> getConfiguration() {
CaffeineConfiguration<Integer, Integer> configuration = new CaffeineConfiguration<>();
configuration.setExpiryPolicyFactory(() -> new CreatedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS, EXPIRY_DURATION)));
configuration.setTickerFactory(() -> ticker::read);
return configuration;
}
Aggregations