Package com.hazelcast.client.config

Examples of com.hazelcast.client.config.ClientNetworkConfig


                                       LoadBalancer loadBalancer,
                                       AddressTranslator addressTranslator) {
        this.client = client;
        this.addressTranslator = addressTranslator;
        final ClientConfig config = client.getClientConfig();
        final ClientNetworkConfig networkConfig = config.getNetworkConfig();

        final int connTimeout = networkConfig.getConnectionTimeout();
        connectionTimeout = connTimeout == 0 ? Integer.MAX_VALUE : connTimeout;

        final ClientProperties clientProperties = client.getClientProperties();
        int timeout = clientProperties.getHeartbeatTimeout().getInteger();
        this.heartBeatTimeout = timeout > 0 ? timeout : Integer.parseInt(PROP_HEARTBEAT_TIMEOUT_DEFAULT);

        int interval = clientProperties.getHeartbeatInterval().getInteger();
        heartBeatInterval = interval > 0 ? interval : Integer.parseInt(PROP_HEARTBEAT_INTERVAL_DEFAULT);

        smartRouting = networkConfig.isSmartRouting();
        executionService = (ClientExecutionServiceImpl) client.getClientExecutionService();
        credentials = initCredentials(config);
        router = new Router(loadBalancer);

        inSelector = new InSelectorImpl(
                client.getThreadGroup(),
                "InSelector",
                Logger.getLogger(InSelectorImpl.class),
                OUT_OF_MEMORY_HANDLER);
        outSelector = new OutSelectorImpl(
                client.getThreadGroup(),
                "OutSelector",
                Logger.getLogger(OutSelectorImpl.class),
                OUT_OF_MEMORY_HANDLER);

        socketOptions = networkConfig.getSocketOptions();
        ClientExtension clientExtension = client.getClientExtension();
        socketChannelWrapperFactory = clientExtension.getSocketChannelWrapperFactory();
        socketInterceptor = initSocketInterceptor(networkConfig.getSocketInterceptorConfig());
    }
View Full Code Here


        private final Object ownerConnectionLock = new Object();
        private volatile ClientConnection ownerConnection;

        private ClientConnection getOrWaitForCreation() throws IOException {
            ClientNetworkConfig networkConfig = client.getClientConfig().getNetworkConfig();
            long connectionAttemptLimit = networkConfig.getConnectionAttemptLimit();
            long connectionAttemptPeriod = networkConfig.getConnectionAttemptPeriod();
            long waitTime = connectionAttemptLimit * connectionAttemptPeriod * 2;
            if (waitTime < 0) {
                waitTime = Long.MAX_VALUE;
            }

View Full Code Here

            c.close();
        }
    }

    private ClientConnection connectToOne() throws Exception {
        final ClientNetworkConfig networkConfig = client.getClientConfig().getNetworkConfig();
        final int connAttemptLimit = networkConfig.getConnectionAttemptLimit();
        final int connectionAttemptPeriod = networkConfig.getConnectionAttemptPeriod();

        final int connectionAttemptLimit = connAttemptLimit == 0 ? Integer.MAX_VALUE : connAttemptLimit;

        int attempt = 0;
        Throwable lastError = null;
View Full Code Here

TOP

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

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.