use of org.infinispan.configuration.cache.PersistenceConfiguration in project wildfly by wildfly.
the class StoreBuilder method configure.
@Override
public Builder<PersistenceConfiguration> configure(OperationContext context, ModelNode model) throws OperationFailedException {
this.storeBuilder = this.storeBuilderFactory.apply(context, model);
this.storeBuilder.persistence().passivation(PASSIVATION.resolveModelAttribute(context, model).asBoolean());
Properties properties = new Properties();
ModelNodes.optionalPropertyList(PROPERTIES.resolveModelAttribute(context, model)).ifPresent(list -> list.forEach(property -> properties.setProperty(property.getName(), property.getValue().asString())));
this.storeBuilder.fetchPersistentState(FETCH_STATE.resolveModelAttribute(context, model).asBoolean()).preload(PRELOAD.resolveModelAttribute(context, model).asBoolean()).purgeOnStartup(PURGE.resolveModelAttribute(context, model).asBoolean()).shared(SHARED.resolveModelAttribute(context, model).asBoolean()).singleton().enabled(SINGLETON.resolveModelAttribute(context, model).asBoolean()).withProperties(properties);
return this;
}
use of org.infinispan.configuration.cache.PersistenceConfiguration in project wildfly by wildfly.
the class LocalCacheBuilder method accept.
@Override
public void accept(ConfigurationBuilder builder) {
super.accept(builder);
builder.clustering().cacheMode(CacheMode.LOCAL);
TransactionConfiguration transaction = this.transaction.getValue();
PersistenceConfiguration persistence = this.persistence.getValue();
// Auto-enable simple cache optimization if cache is non-transactional and non-persistent
builder.simpleCache(!transaction.transactionMode().isTransactional() && !persistence.usingStores());
if (InfinispanLogger.ROOT_LOGGER.isTraceEnabled() && builder.simpleCache()) {
InfinispanLogger.ROOT_LOGGER.tracef("Simple cache optimization for %s = %b", this.address, builder.simpleCache());
}
}
Aggregations