Package com.hazelcast.client.impl.client

Examples of com.hazelcast.client.impl.client.ClientResponse


        try {
            packet = (Packet) connection.q.take();
        } catch (InterruptedException e) {
            throw new HazelcastException(e);
        }
        ClientResponse clientResponse = serializationService.toObject(packet.getData());
        return serializationService.toObject(clientResponse.getResponse());
    }
View Full Code Here


        out.flush();
    }

    public Object receive() throws IOException {
        Data responseData = in.readData();
        ClientResponse clientResponse = serializationService.toObject(responseData);
        return serializationService.toObject(clientResponse.getResponse());
    }
View Full Code Here

        return new DataSerializableFactory() {
            @Override
            public IdentifiedDataSerializable create(int typeId) {
                switch (typeId) {
                    case CLIENT_RESPONSE:
                        return new ClientResponse();
                    default:
                        return null;
                }
            }
        };
View Full Code Here

        return nodeEngine.getProxyService();
    }

    public void sendResponse(ClientEndpointImpl endpoint, Object response, int callId, boolean isError, boolean isEvent) {
        Data data = serializationService.toData(response);
        ClientResponse clientResponse = new ClientResponse(data, callId, isError);
        sendResponse(endpoint, clientResponse, isEvent);
    }
View Full Code Here

    @Override
    public Object sendAndReceive(ClientRequest request, ClientConnection connection) throws Exception {
        final SerializationService ss = client.getSerializationService();
        connection.write(ss.toData(request));
        final Data data = connection.read();
        ClientResponse clientResponse = ss.toObject(data);
        Object response = ss.toObject(clientResponse.getResponse());
        if (response instanceof Throwable) {
            Throwable t = (Throwable) response;
            ExceptionUtil.fixRemoteStackTrace(t, Thread.currentThread().getStackTrace());
            throw new Exception(t);
        }
View Full Code Here

        }

        private void process(Packet packet) {
            try {
                final ClientConnection conn = (ClientConnection) packet.getConn();
                final ClientResponse clientResponse = client.getSerializationService().toObject(packet.getData());
                final int callId = clientResponse.getCallId();
                final Data response = clientResponse.getResponse();
                handlePacket(response, clientResponse.isError(), callId, conn);
                conn.decrementPacketCount();
            } catch (Exception e) {
                logger.severe("Failed to process task: " + packet + " on responseThread :" + getName());
            }
        }
View Full Code Here

        }

        @Override
        public void run() {
            final ClientConnection conn = (ClientConnection) packet.getConn();
            final ClientResponse clientResponse = serializationService.toObject(packet.getData());
            final int callId = clientResponse.getCallId();
            final Data response = clientResponse.getResponse();
            handleEvent(response, callId, conn);
        }
View Full Code Here

    private void listenMembershipEvents() throws IOException {
        final SerializationService serializationService = clusterService.getSerializationService();
        while (!Thread.currentThread().isInterrupted()) {
            final Data clientResponseData = conn.read();
            final ClientResponse clientResponse = serializationService.toObject(clientResponseData);
            final Object eventObject = serializationService.toObject(clientResponse.getResponse());
            final ClientMembershipEvent event = (ClientMembershipEvent) eventObject;
            final MemberImpl member = (MemberImpl) event.getMember();
            boolean membersUpdated = false;
            if (event.getEventType() == MembershipEvent.MEMBER_ADDED) {
                members.add(member);
View Full Code Here

TOP

Related Classes of com.hazelcast.client.impl.client.ClientResponse

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.