use of org.infinispan.configuration.cache.MemoryConfigurationBuilder in project wildfly by wildfly.
the class MemoryServiceConfigurator method get.
@Override
public MemoryConfiguration get() {
EvictionStrategy strategy = this.size > 0 ? EvictionStrategy.REMOVE : EvictionStrategy.MANUAL;
MemoryConfigurationBuilder builder = new ConfigurationBuilder().memory().storage(this.storageType).whenFull(strategy);
if (strategy.isEnabled()) {
if (this.unit == MemorySizeUnit.ENTRIES) {
builder.maxCount(this.size);
} else {
builder.maxSize(Long.toString(this.unit.applyAsLong(this.size)));
}
}
return builder.create();
}
Aggregations