Package com.hazelcast.nio.serialization

Examples of com.hazelcast.nio.serialization.DataAdapter


    }

    void sendResponse(ClientEndpoint endpoint, ClientResponse response) {
        Data resultData = serializationService.toData(response);
        Connection conn = endpoint.getConnection();
        conn.write(new DataAdapter(resultData, serializationService.getSerializationContext()));
    }
View Full Code Here


    private void _send(ClientCallFuture future, ClientConnection connection) {
        connection.registerCallId(future);
        future.setConnection(connection);
        final SerializationService ss = client.getSerializationService();
        final Data data = ss.toData(future.getRequest());
        if (!connection.write(new DataAdapter(data))) {
            final int callId = future.getRequest().getCallId();
            connection.deRegisterCallId(callId);
            connection.deRegisterEventHandler(callId);
            future.notify(new TargetNotMemberException("Address : " + connection.getRemoteEndpoint()));
        }
View Full Code Here

    public void write(Data data) throws IOException {
        final int totalSize = data.totalSize();
        final int bufferSize = ClientConnectionManagerImpl.BUFFER_SIZE;
        final ByteBuffer buffer = ByteBuffer.allocate(totalSize > bufferSize ? bufferSize : totalSize);
        final DataAdapter packet = new DataAdapter(data);
        boolean complete = false;
        while (!complete) {
            complete = packet.writeTo(buffer);
            buffer.flip();
            try {
                socketChannelWrapper.write(buffer);
            } catch (Exception e) {
                throw ExceptionUtil.rethrow(e);
View Full Code Here

TOP

Related Classes of com.hazelcast.nio.serialization.DataAdapter

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.