use of com.hazelcast.client.config.ClientNetworkConfig in project hazelcast by hazelcast.
the class HazelcastClientInstanceImpl method initDiscoveryService.
private DiscoveryService initDiscoveryService(ClientConfig config) {
// and strategies are resolved but the AddressProvider is never registered
if (!properties.getBoolean(ClientProperty.DISCOVERY_SPI_ENABLED)) {
return null;
}
ILogger logger = loggingService.getLogger(DiscoveryService.class);
ClientNetworkConfig networkConfig = config.getNetworkConfig();
DiscoveryConfig discoveryConfig = networkConfig.getDiscoveryConfig().getAsReadOnly();
DiscoveryServiceProvider factory = discoveryConfig.getDiscoveryServiceProvider();
if (factory == null) {
factory = new DefaultDiscoveryServiceProvider();
}
DiscoveryServiceSettings settings = new DiscoveryServiceSettings().setConfigClassLoader(config.getClassLoader()).setLogger(logger).setDiscoveryMode(DiscoveryMode.Client).setDiscoveryConfig(discoveryConfig);
DiscoveryService discoveryService = factory.newDiscoveryService(settings);
discoveryService.start();
return discoveryService;
}
use of com.hazelcast.client.config.ClientNetworkConfig in project hazelcast by hazelcast.
the class DummyClientCachePartitionIteratorTest method getClientConfig.
private static ClientConfig getClientConfig(HazelcastInstance instance) {
Address address = instance.getCluster().getLocalMember().getAddress();
String addressString = address.getHost() + ":" + address.getPort();
ClientConfig clientConfig = new ClientConfig();
ClientNetworkConfig networkConfig = new ClientNetworkConfig();
networkConfig.setSmartRouting(false);
networkConfig.addAddress(addressString);
clientConfig.setNetworkConfig(networkConfig);
return clientConfig;
}
use of com.hazelcast.client.config.ClientNetworkConfig in project hazelcast by hazelcast.
the class ClientReplicatedMapLiteMemberTest method configureDummyClientConnection.
private void configureDummyClientConnection(HazelcastInstance instance) throws UnknownHostException {
InetSocketAddress socketAddress = getAddress(instance).getInetSocketAddress();
dummyClientConfig.setProperty(ClientProperty.SHUFFLE_MEMBER_LIST.getName(), "false");
ClientNetworkConfig networkConfig = dummyClientConfig.getNetworkConfig();
networkConfig.addAddress(socketAddress.getHostName() + ":" + socketAddress.getPort());
}
Aggregations