Examples of HazelcastClientProxy


Examples of com.hazelcast.client.impl.HazelcastClientProxy

        if (config == null) {
            config = new XmlClientConfigBuilder().build();
        }

        final ClassLoader tccl = Thread.currentThread().getContextClassLoader();
        HazelcastClientProxy proxy;
        try {
            Thread.currentThread().setContextClassLoader(HazelcastClient.class.getClassLoader());
            final HazelcastClientInstanceImpl client = new HazelcastClientInstanceImpl(config);
            client.start();
            OutOfMemoryErrorDispatcher.register(client);
            proxy = new HazelcastClientProxy(client);
            CLIENTS.put(client.getName(), proxy);
        } finally {
            Thread.currentThread().setContextClassLoader(tccl);
        }
        return proxy;
View Full Code Here

Examples of com.hazelcast.client.impl.HazelcastClientProxy

     * Shutdown the provided client and remove it from the managed list
     * @param instance the hazelcast client instance
     */
    public static void shutdown(HazelcastInstance instance) {
        if(instance instanceof HazelcastClientProxy){
            final HazelcastClientProxy proxy = (HazelcastClientProxy) instance;
            String instanceName = proxy.client.getName();
            try {
                proxy.client.shutdown();
            } catch (Exception ignored) {
                EmptyStatement.ignore(ignored);
View Full Code Here

Examples of com.hazelcast.client.impl.HazelcastClientProxy

    /**
     * Shutdown the provided client and remove it from the managed list
     * @param instanceName the hazelcast client instance name
     */
    public static void shutdown(String instanceName) {
        HazelcastClientProxy proxy = CLIENTS.remove(instanceName);
        if(proxy != null) {
            try {
                proxy.client.shutdown();
            } catch (Exception ignored) {
                EmptyStatement.ignore(ignored);
View Full Code Here

Examples of com.hazelcast.client.impl.HazelcastClientProxy

        props.setProperty(CacheEnvironment.NATIVE_CLIENT_ADDRESS, "localhost");
        SessionFactory sf = createSessionFactory(props);
        HazelcastInstance hz = HazelcastAccessor.getHazelcastInstance(sf);
        assertTrue(hz instanceof HazelcastClientProxy);
        assertEquals(1, main.getCluster().getMembers().size());
        HazelcastClientProxy client = (HazelcastClientProxy) hz;
        ClientConfig clientConfig = client.getClientConfig();
        assertEquals("dev-custom", clientConfig.getGroupConfig().getName());
        assertEquals("dev-pass", clientConfig.getGroupConfig().getPassword());
        assertTrue(clientConfig.getNetworkConfig().isSmartRouting());
        assertTrue(clientConfig.getNetworkConfig().isRedoOperation());
        Hazelcast.newHazelcastInstance(new ClasspathXmlConfig("hazelcast-custom.xml"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.