Examples of BinaryNodeStateProtocol


Examples of com.sleepycat.je.rep.impl.BinaryNodeStateProtocol

    /* Get the state of the specified node. */
    public NodeState getNodeState()
        throws IOException, ServiceConnectFailedException {

        BinaryNodeStateProtocol protocol =
            new BinaryNodeStateProtocol(NameIdPair.NOCHECK, null);
        SocketChannel channel = null;

        try {
            /* Build the connection. */
            channel = RepUtils.openBlockingChannel(socketAddress,
                                                   true,
                                                   socketTimeout);
            ServiceDispatcher.doServiceHandshake
                (channel, BinaryNodeStateService.SERVICE_NAME);

            /* Send a NodeState request to the node. */
            protocol.write
                (protocol.new BinaryNodeStateRequest(nodeName, groupName),
                 channel);

            /* Get the response and return the NodeState. */
            BinaryNodeStateResponse response =
                protocol.read(channel, BinaryNodeStateResponse.class);

            return response.convertToNodeState();
        } finally {
            if (channel != null) {
                channel.close();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.