Package com.hazelcast.client.connection.nio

Examples of com.hazelcast.client.connection.nio.ClientConnection


    public Xid[] recover() {
        final SerializationService serializationService = client.getSerializationService();
        final ClientInvocationServiceImpl invocationService = (ClientInvocationServiceImpl) client.getInvocationService();
        final Xid[] empty = new Xid[0];
        try {
            final ClientConnection connection = connect();
            if (connection == null) {
                return empty;
            }
            final RecoverAllTransactionsRequest request = new RecoverAllTransactionsRequest();
            final ICompletableFuture<SerializableCollection> future = invocationService.send(request, connection);
View Full Code Here


    }

    public boolean recover(Xid xid, boolean commit) {
        final SerializableXID sXid = new SerializableXID(xid.getFormatId(),
                xid.getGlobalTransactionId(), xid.getBranchQualifier());
        final ClientConnection connection = recoveredTransactions.remove(sXid);
        if (connection == null) {
            return false;
        }
        final ClientInvocationServiceImpl invocationService = (ClientInvocationServiceImpl) client.getInvocationService();
        final RecoverTransactionRequest request = new RecoverTransactionRequest(sXid, commit);
View Full Code Here

    public Xid[] recover() {
        final SerializationService serializationService = client.getSerializationService();
        final ClientInvocationServiceImpl invocationService = (ClientInvocationServiceImpl) client.getInvocationService();
        final Xid[] empty = new Xid[0];
        try {
            final ClientConnection connection = connect();
            if (connection == null) {
                return empty;
            }
            final RecoverAllTransactionsRequest request = new RecoverAllTransactionsRequest();
            final ICompletableFuture<SerializableCollection> future = invocationService.send(request, connection);
View Full Code Here

    }

    public boolean recover(Xid xid, boolean commit) {
        final SerializableXID sXid = new SerializableXID(xid.getFormatId(),
                xid.getGlobalTransactionId(), xid.getBranchQualifier());
        final ClientConnection connection = recoveredTransactions.remove(sXid);
        if (connection == null) {
            return false;
        }
        final ClientInvocationServiceImpl invocationService = (ClientInvocationServiceImpl) client.getInvocationService();
        final RecoverTransactionRequest request = new RecoverTransactionRequest(sXid, commit);
View Full Code Here

            throws Exception {
        ClientPartitionServiceImpl partitionService = (ClientPartitionServiceImpl) client.getClientPartitionService();
        int partitionId = partitionService.getPartitionId(key);
        final Address owner = partitionService.getPartitionOwner(partitionId);
        if (owner != null) {
            final ClientConnection connection = connectionManager.tryToConnect(owner);
            final ClientCallFuture future = new ClientCallFuture(client, request, handler);
            sendInternal(future, connection, partitionId);
            return future;
        }
        return invokeOnRandomTarget(request);
View Full Code Here

        return sendAndHandle(request, handler);
    }

    public <T> ICompletableFuture<T> invokeOnTarget(ClientRequest request, Address target, EventHandler handler)
            throws Exception {
        final ClientConnection clientConnection = connectionManager.connectToAddress(target);
        request.setSingleConnection();
        return doSend(request, clientConnection, handler);
    }
View Full Code Here

        request.setSingleConnection();
        return doSend(request, connection, null);
    }

    public Future reSend(ClientCallFuture future) throws Exception {
        final ClientConnection connection = connectionManager.tryToConnect(null);
        sendInternal(future, connection, -1);
        return future;
    }
View Full Code Here

    }

    //NIO private

    private ICompletableFuture send(ClientRequest request) throws Exception {
        final ClientConnection connection = connectionManager.tryToConnect(null);
        return doSend(request, connection, null);
    }
View Full Code Here

        final ClientConnection connection = connectionManager.tryToConnect(null);
        return doSend(request, connection, null);
    }

    private ICompletableFuture send(ClientRequest request, Address target) throws Exception {
        final ClientConnection connection = connectionManager.tryToConnect(target);
        return doSend(request, connection, null);
    }
View Full Code Here

        final ClientConnection connection = connectionManager.tryToConnect(target);
        return doSend(request, connection, null);
    }

    private ICompletableFuture sendAndHandle(ClientRequest request, EventHandler handler) throws Exception {
        final ClientConnection connection = connectionManager.tryToConnect(null);
        return doSend(request, connection, handler);
    }
View Full Code Here

TOP

Related Classes of com.hazelcast.client.connection.nio.ClientConnection

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.