public class TimestampTypeOverrides extends TypeOverrides {
@Override
public void validateInfinispanConfiguration(Configuration configuration) throws CacheException {
CacheMode cacheMode = configuration.getCacheMode();
if (cacheMode.equals(CacheMode.INVALIDATION_ASYNC) || cacheMode.equals(CacheMode.INVALIDATION_SYNC)) {
throw new CacheException("Timestamp cache cannot be configured with invalidation");
}
EvictionStrategy strategy = configuration.getEvictionStrategy();
if (!strategy.equals(EvictionStrategy.NONE)) {
throw new CacheException("Timestamp cache cannot be configured with eviction");
}
}