Package com.hazelcast.client.util

Examples of com.hazelcast.client.util.RoundRobinLB


        executionService = new ClientExecutionServiceImpl(instanceName, threadGroup,
                Thread.currentThread().getContextClassLoader(), config.getExecutorPoolSize());
        transactionManager = new ClientTransactionManager(this);
        LoadBalancer lb = config.getLoadBalancer();
        if (lb == null) {
            lb = new RoundRobinLB();
        }
        loadBalancer = lb;
        connectionManager = new ClientConnectionManagerImpl(this, loadBalancer);
        clusterService = new ClientClusterServiceImpl(this);
        invocationService = new ClientInvocationServiceImpl(this);
View Full Code Here


    private void handleLoadBalancer(Node node) {
        final String type = getAttribute(node, "type");
        if ("random".equals(type)) {
            clientConfig.setLoadBalancer(new RandomLB());
        } else if ("round-robin".equals(type)) {
            clientConfig.setLoadBalancer(new RoundRobinLB());
        }
    }
View Full Code Here

        private void handleLoadBalancer(Node node) {
            final String type = getAttribute(node, "type");
            if ("random".equals(type)) {
                configBuilder.addPropertyValue("loadBalancer", new RandomLB());
            } else if ("round-robin".equals(type)) {
                configBuilder.addPropertyValue("loadBalancer", new RoundRobinLB());
            }
        }
View Full Code Here

        proxyManager = new ProxyManager(this);
        executionService = initExecutorService();
        transactionManager = new ClientTransactionManager(this);
        LoadBalancer lb = config.getLoadBalancer();
        if (lb == null) {
            lb = new RoundRobinLB();
        }
        loadBalancer = lb;
        connectionManager = createClientConnectionManager();
        clusterService = new ClientClusterServiceImpl(this);
        invocationService = new ClientInvocationServiceImpl(this);
View Full Code Here

    private void handleLoadBalancer(Node node) {
        final String type = getAttribute(node, "type");
        if ("random".equals(type)) {
            clientConfig.setLoadBalancer(new RandomLB());
        } else if ("round-robin".equals(type)) {
            clientConfig.setLoadBalancer(new RoundRobinLB());
        }
    }
View Full Code Here

        private void handleLoadBalancer(Node node) {
            final String type = getAttribute(node, "type");
            if ("random".equals(type)) {
                configBuilder.addPropertyValue("loadBalancer", new RandomLB());
            } else if ("round-robin".equals(type)) {
                configBuilder.addPropertyValue("loadBalancer", new RoundRobinLB());
            }
        }
View Full Code Here

        proxyManager = new ProxyManager(this);
        executionService = initExecutorService();
        transactionManager = new ClientTransactionManager(this);
        LoadBalancer lb = config.getLoadBalancer();
        if (lb == null) {
            lb = new RoundRobinLB();
        }
        loadBalancer = lb;
        connectionManager = createClientConnectionManager();
        clusterService = new ClientClusterServiceImpl(this);
        invocationService = new ClientInvocationServiceImpl(this);
View Full Code Here

        Hazelcast.shutdownAll();
    }

    @Test
    public void testRoundRobinLB_withoutMembers() {
        RoundRobinLB lb = new RoundRobinLB();
        Member m = lb.next();
        assertNull(m);
    }
View Full Code Here

        assertNull(m);
    }

    @Test
    public void testRoundRobinLB_withMembers() {
        RoundRobinLB roundRobinLB = new RoundRobinLB();
        TestHazelcastInstanceFactory factory = new TestHazelcastInstanceFactory(1);
        final HazelcastInstance server = factory.newHazelcastInstance();

        Cluster cluster = server.getCluster();

        ClientConfig clientConfig = new ClientConfig();
        clientConfig.setLoadBalancer(roundRobinLB);

        roundRobinLB.init(cluster, clientConfig);

        Member member = cluster.getLocalMember();
        Member nextMember = roundRobinLB.next();

        assertEquals(member, nextMember);
    }
View Full Code Here

    private void handleLoadBalancer(Node node) {
        final String type = getAttribute(node, "type");
        if ("random".equals(type)) {
            clientConfig.setLoadBalancer(new RandomLB());
        } else if ("round-robin".equals(type)) {
            clientConfig.setLoadBalancer(new RoundRobinLB());
        }
    }
View Full Code Here

TOP

Related Classes of com.hazelcast.client.util.RoundRobinLB

Copyright © 2018 www.massapicom. 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.