Search in sources :

Example 1 with ClientConnectionManagerFactory

use of com.hazelcast.client.impl.clientside.ClientConnectionManagerFactory 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;
}
Also used : ClientConnectionManagerFactory(com.hazelcast.client.impl.clientside.ClientConnectionManagerFactory) DefaultClientConnectionManagerFactory(com.hazelcast.client.impl.clientside.DefaultClientConnectionManagerFactory) HazelcastClientInstanceImpl(com.hazelcast.client.impl.clientside.HazelcastClientInstanceImpl) DefaultClientConnectionManagerFactory(com.hazelcast.client.impl.clientside.DefaultClientConnectionManagerFactory) HazelcastClientProxy(com.hazelcast.client.impl.clientside.HazelcastClientProxy)

Aggregations

ClientConnectionManagerFactory (com.hazelcast.client.impl.clientside.ClientConnectionManagerFactory)1 DefaultClientConnectionManagerFactory (com.hazelcast.client.impl.clientside.DefaultClientConnectionManagerFactory)1 HazelcastClientInstanceImpl (com.hazelcast.client.impl.clientside.HazelcastClientInstanceImpl)1 HazelcastClientProxy (com.hazelcast.client.impl.clientside.HazelcastClientProxy)1