use of com.hazelcast.client.connection.nio.ClientConnectionManagerImpl in project hazelcast by hazelcast.
the class DefaultClientConnectionManagerFactory method createConnectionManager.
@Override
public ClientConnectionManager createConnectionManager(ClientConfig config, HazelcastClientInstanceImpl client, DiscoveryService discoveryService) {
LoggingService loggingService = client.getLoggingService();
ILogger logger = loggingService.getLogger(HazelcastClient.class);
ClientAwsConfig awsConfig = config.getNetworkConfig().getAwsConfig();
AddressTranslator addressTranslator;
if (awsConfig != null && awsConfig.isEnabled()) {
try {
addressTranslator = new AwsAddressTranslator(awsConfig, loggingService);
} catch (NoClassDefFoundError e) {
logger.warning("hazelcast-aws.jar might be missing!");
throw e;
}
} else if (discoveryService != null) {
addressTranslator = new DiscoveryAddressTranslator(discoveryService, client.getProperties().getBoolean(ClientProperty.DISCOVERY_SPI_PUBLIC_IP_ENABLED));
} else {
addressTranslator = new DefaultAddressTranslator();
}
return new ClientConnectionManagerImpl(client, addressTranslator);
}
Aggregations