use of org.infinispan.client.hotrod.TransportFactory in project infinispan by infinispan.
the class ConfigurationBuilder method create.
@Override
public Configuration create() {
List<ServerConfiguration> servers = new ArrayList<>();
if (this.servers.size() > 0)
for (ServerConfigurationBuilder server : this.servers) {
servers.add(server.create());
}
else {
servers.add(new ServerConfiguration("127.0.0.1", ConfigurationProperties.DEFAULT_HOTROD_PORT));
}
List<ClusterConfiguration> serverClusterConfigs = clusters.stream().map(ClusterConfigurationBuilder::create).collect(Collectors.toList());
Marshaller buildMarshaller = this.marshaller;
if (buildMarshaller == null && marshallerClass == null) {
buildMarshaller = handleNullMarshaller();
}
Class<? extends Marshaller> buildMarshallerClass = this.marshallerClass;
if (buildMarshallerClass == null) {
// Populate the marshaller class as well, so it can be exported to properties
buildMarshallerClass = buildMarshaller.getClass();
} else {
if (buildMarshaller != null && !buildMarshallerClass.isInstance(buildMarshaller))
throw new IllegalArgumentException("Both marshaller and marshallerClass attributes are present, but marshaller is not an instance of marshallerClass");
}
Map<String, RemoteCacheConfiguration> remoteCaches = remoteCacheBuilders.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().create()));
return new Configuration(asyncExecutorFactory.create(), balancingStrategyFactory, classLoader == null ? null : classLoader.get(), clientIntelligence, connectionPool.create(), connectionTimeout, consistentHashImpl, forceReturnValues, keySizeEstimate, buildMarshaller, buildMarshallerClass, protocolVersion, servers, socketTimeout, security.create(), tcpNoDelay, tcpKeepAlive, valueSizeEstimate, maxRetries, nearCache.create(), serverClusterConfigs, allowListRegExs, batchSize, transaction.create(), statistics.create(), features, contextInitializers, remoteCaches, transportFactory);
}
Aggregations