Package com.hazelcast.nio

Examples of com.hazelcast.nio.Connection


        return send(packet, target, null);
    }

    private boolean send(Packet packet, Address target, FutureSend futureSend) {
        final ConnectionManager connectionManager = node.getConnectionManager();
        final Connection connection = connectionManager.getConnection(target);
        if (connection != null) {
            return send(packet, connection);
        } else {
            if (futureSend == null) {
                futureSend = new FutureSend(packet, target);
View Full Code Here


                InvocationBuilder.DEFAULT_TRY_PAUSE_MILLIS,
                InvocationBuilder.DEFAULT_CALL_TIMEOUT, null, null, InvocationBuilder.DEFAULT_DESERIALIZE_RESULT).invoke();
    }

    private void processPacket(Packet packet) {
        final Connection conn = packet.getConn();
        try {
            final Address caller = conn.getEndPoint();
            final Data data = packet.getData();
            final Object object = nodeEngine.toObject(data);
            final Operation op = (Operation) object;
            op.setNodeEngine(nodeEngine);
            OperationAccessor.setCallerAddress(op, caller);
View Full Code Here

    void handleEvent(Packet packet) {
        try {
            eventExecutor.execute(new RemoteEventPacketProcessor(packet));
        } catch (RejectedExecutionException e) {
            if (eventExecutor.isLive()) {
                final Connection conn = packet.getConn();
                String endpoint = conn.getEndPoint() != null ? conn.getEndPoint().toString() : conn.toString();
                logger.warning("EventQueue overloaded! Failed to process event packet sent from: " + endpoint);
            }
        }
    }
View Full Code Here

        }
        return validJoinRequest;
    }

    private void logIfConnectionToEndpointIsMissing(MemberImpl member) {
        Connection conn = node.connectionManager.getOrConnect(member.getAddress());
        if (conn == null || !conn.live()) {
            logger.warning("This node does not have a connection to " + member);
        }
    }
View Full Code Here

        }

        @Override
        public void sendResponse(Object obj) {
            long callId = op.getCallId();
            Connection conn = op.getConnection();
            if (!sent.compareAndSet(false, true) && !(obj instanceof Throwable)) {
                throw new ResponseAlreadySentException("NormalResponse already sent for call: " + callId
                        + " to " + conn.getEndPoint() + ", current-response: " + obj);
            }

            NormalResponse response;
            if (!(obj instanceof NormalResponse)) {
                response = new NormalResponse(obj, op.getCallId(), 0, op.isUrgent());
View Full Code Here

    void handleEvent(Packet packet) {
        try {
            eventExecutor.execute(new RemoteEventPacketProcessor(packet));
        } catch (RejectedExecutionException e) {
            if (eventExecutor.isLive()) {
                final Connection conn = packet.getConn();
                String endpoint = conn.getEndPoint() != null ? conn.getEndPoint().toString() : conn.toString();
                logger.warning("EventQueue overloaded! Failed to process event packet sent from: " + endpoint);
            }
        }
    }
View Full Code Here

            }
            if (node.isMaster()) {
                setJoins.remove(new MemberInfo(deadAddress));
                resetMemberMasterConfirmations();
            }
            final Connection conn = node.connectionManager.getConnection(deadAddress);
            if (destroyConnection && conn != null) {
                node.connectionManager.destroyConnection(conn);
            }
            MemberImpl deadMember = getMember(deadAddress);
            if (deadMember != null) {
View Full Code Here

        if (!node.isMaster()) {
            sendMasterAnswer(joinRequest.getAddress());
            return;
        }

        Connection conn = op.getConnection();
        if (!isValidJoinRequest(joinRequest)) {
            logger.info("Received an invalid join request from " + joinRequest.getAddress());
            conn.close();
            return;
        }

        if (joinInProgress) {
            if (logger.isFinestEnabled()) {
View Full Code Here

                if (logger.isFinestEnabled()) {
                    logger.finest("Handling master response: " + this);
                }
                final Address currentMaster = node.getMasterAddress();
                if (currentMaster != null && !currentMaster.equals(masterAddress)) {
                    final Connection conn = node.connectionManager.getConnection(currentMaster);
                    if (conn != null && conn.live()) {
                        logger.warning("Ignoring master response from " + masterAddress +
                                ", since this node has an active master: " + currentMaster);
                        return;
                    }
                }
View Full Code Here

        }
    }

    private boolean authenticate() {
        ClientEngineImpl clientEngine = getService();
        Connection connection = endpoint.getConnection();
        ILogger logger = clientEngine.getLogger(getClass());
        boolean authenticated;
        if (credentials == null) {
            authenticated = false;
            logger.severe("Could not retrieve Credentials object!");
View Full Code Here

TOP

Related Classes of com.hazelcast.nio.Connection

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.