use of org.infinispan.client.hotrod.configuration.NearCacheMode in project wildfly by wildfly.
the class RemoteCacheServiceConfigurator method get.
@Override
public RemoteCache<K, V> get() {
String templateName = (this.configurationName != null) ? this.configurationName : DefaultTemplate.DIST_SYNC.getTemplateName();
NearCacheMode mode = this.nearCacheFactory.getMode();
Consumer<RemoteCacheConfigurationBuilder> configurator = new Consumer<RemoteCacheConfigurationBuilder>() {
@Override
public void accept(RemoteCacheConfigurationBuilder builder) {
builder.forceReturnValues(false).nearCacheMode(mode).transactionMode(TransactionMode.NONE).templateName(templateName);
}
};
this.container.get().getConfiguration().addRemoteCache(this.cacheName, configurator);
RemoteCacheContainer container = this.container.get();
try (RemoteCacheContainer.NearCacheRegistration registration = (this.nearCacheFactory != null) ? container.registerNearCacheFactory(this.cacheName, this.nearCacheFactory) : null) {
RemoteCache<K, V> cache = container.getCache(this.cacheName);
cache.start();
return cache;
}
}
Aggregations