Package com.hazelcast.client.config

Examples of com.hazelcast.client.config.ClientConfig


    private OomeOnClientAuthenticationMain() {
    }

    public static void main(String[] args) {
        HazelcastInstance hz = Hazelcast.newHazelcastInstance();
        ClientConfig clientConfig = new ClientConfig();
        clientConfig.getGroupConfig().setPassword("foo");
        clientConfig.getNetworkConfig().setConnectionAttemptLimit(0);

        for (int k = 0; k < 1000000; k++) {
            System.out.println("At:" + k);
            try {
                HazelcastClient.newHazelcastClient(clientConfig);
View Full Code Here


            ex.shutdown();
        }
    }

    private void runClient(Task task, int executions) throws InterruptedException, ExecutionException {
        ClientConfig clientConfig = new ClientConfig();
        clientConfig.getNetworkConfig().setRedoOperation(true);
        HazelcastInstance client = HazelcastClient.newHazelcastClient(clientConfig);
        IExecutorService executor = client.getExecutorService("executor");
        for (int i = 0; i < executions; i++) {
            Future future = executor.submitToKeyOwner(task, i);
            future.get();
View Full Code Here

        HazelcastClient.shutdownAll();
    }

    @Test
    public void testCustomProxy_usingFactoryClassName() {
        ClientConfig clientConfig = new ClientConfig();
        ProxyFactoryConfig proxyFactoryConfig = new ProxyFactoryConfig();
        proxyFactoryConfig.setService(SERVICE_NAME);
        proxyFactoryConfig.setClassName(CustomProxyFactory.class.getName());
        clientConfig.addProxyFactoryConfig(proxyFactoryConfig);

        testCustomProxy(clientConfig);
    }
View Full Code Here

        testCustomProxy(clientConfig);
    }

    @Test
    public void testCustomProxy_usingFactoryImplementation() {
        ClientConfig clientConfig = new ClientConfig();
        ProxyFactoryConfig proxyFactoryConfig = new ProxyFactoryConfig();
        proxyFactoryConfig.setService(SERVICE_NAME);
        proxyFactoryConfig.setFactoryImpl(new CustomProxyFactory());
        clientConfig.addProxyFactoryConfig(proxyFactoryConfig);

        testCustomProxy(clientConfig);
    }
View Full Code Here

        Hazelcast.shutdownAll();
    }

    @Test(timeout = 20000, expected = IllegalStateException.class)
    public void testTimeoutToOutsideNetwork() throws Exception {
        ClientConfig clientConfig = new ClientConfig();
        clientConfig.getGroupConfig().setName("dev").setPassword("dev-pass");
        clientConfig.getNetworkConfig().addAddress("8.8.8.8:5701");
        HazelcastInstance client = HazelcastClient.newHazelcastClient(clientConfig);
        IList<Object> list = client.getList("test");
    }
View Full Code Here

        testConnectionTimeout(0);
    }

    public void testConnectionTimeout(int timeoutInMillis) {
        //Should work without throwing exception.
        final ClientConfig clientConfig = new ClientConfig();
        clientConfig.getNetworkConfig().setConnectionTimeout(timeoutInMillis);
        Hazelcast.newHazelcastInstance();
        HazelcastClient.newHazelcastClient(clientConfig);
    }
View Full Code Here

    HazelcastInstance client;

    @Before
    public void setup() {
        ClientConfig config = new ClientConfig();
        config.getSerializationConfig().addPortableFactory(5, new PortableFactory() {
            @Override
            public Portable create(int classId) {
                if (classId == 6) {
                    return new ClientRegressionTest.SamplePortable();
                }
View Full Code Here

    @Test
    public void cacheManagerByInstanceNameTest()
            throws URISyntaxException {
        assertEquals(0, HazelcastClient.getAllHazelcastClients().size() );
        ClientConfig clientConfig = new ClientConfig();
        clientConfig.getGroupConfig().setName("cluster1");
        clientConfig.getGroupConfig().setPassword("cluster1pass");

        HazelcastInstance client = HazelcastClient.newHazelcastClient(clientConfig);
        String instanceName =client.getName();

        URI uri1 = new URI("MY-SCOPE");
View Full Code Here

    @Override
    protected CachingProvider getCachingProvider() {
        Hazelcast.newHazelcastInstance();
        Hazelcast.newHazelcastInstance();

        ClientConfig clientConfig = new ClientConfig();
        clientConfig.getNetworkConfig().addAddress("127.0.0.1");

        HazelcastInstance client = HazelcastClient.newHazelcastClient(clientConfig);

        return HazelcastClientCachingProvider.createCachingProvider(client);
    }
View Full Code Here

    public static final int STATS_SECONDS = 10;
    public static int GET_PERCENTAGE = 40;
    public static int PUT_PERCENTAGE = 40;

    public static void main(String[] args) {
        final ClientConfig clientConfig = new ClientConfig();
        final HazelcastInstance instance1 = Hazelcast.newHazelcastInstance();
        final HazelcastInstance instance2 = Hazelcast.newHazelcastInstance();
//        final HazelcastInstance client = HazelcastClient.newHazelcastClient(clientConfig);
        final Stats stats = new Stats();
        if (args != null && args.length > 0) {
View Full Code Here

TOP

Related Classes of com.hazelcast.client.config.ClientConfig

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.