use of com.hazelcast.client.impl.clientside.DefaultClientConnectionManagerFactory in project hazelcast by hazelcast.
the class HazelcastClient method constructHazelcastClient.
private static HazelcastInstance constructHazelcastClient(AddressProvider addressProvider, ClientConfig clientConfig, ClientFailoverConfig failoverConfig, String instanceName, InstanceFuture<HazelcastClientProxy> future) {
final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
HazelcastClientProxy proxy;
try {
Thread.currentThread().setContextClassLoader(HazelcastClient.class.getClassLoader());
ClientConnectionManagerFactory factory = new DefaultClientConnectionManagerFactory();
HazelcastClientInstanceImpl client = new HazelcastClientInstanceImpl(instanceName, clientConfig, failoverConfig, factory, addressProvider);
client.start();
OutOfMemoryErrorDispatcher.registerClient(client);
proxy = new HazelcastClientProxy(client);
future.set(proxy);
} catch (Throwable t) {
throw ExceptionUtil.rethrow(t);
} finally {
Thread.currentThread().setContextClassLoader(contextClassLoader);
}
return proxy;
}
Aggregations