Search in sources :

Example 1 with SocketStateChangeResult

use of com.navercorp.pinpoint.rpc.common.SocketStateChangeResult in project pinpoint by naver.

the class DefaultPinpointClientHandler method initReconnect.

@Override
public void initReconnect() {
    logger.info("{} initReconnect() started.", objectUniqName);
    SocketStateChangeResult stateChangeResult = state.toBeingConnect();
    if (!stateChangeResult.isChange()) {
        throw new IllegalStateException("Failed to execute initReconnect() method. Error:" + stateChangeResult);
    }
    logger.info("{} initReconnect() completed.", objectUniqName);
}
Also used : SocketStateChangeResult(com.navercorp.pinpoint.rpc.common.SocketStateChangeResult)

Example 2 with SocketStateChangeResult

use of com.navercorp.pinpoint.rpc.common.SocketStateChangeResult in project pinpoint by naver.

the class PinpointClientHandlerState method to.

private SocketStateChangeResult to(SocketStateCode nextState) {
    String objectName = clientHandler.getObjectName();
    PinpointSocket pinpointSocket = clientHandler.getPinpointClient();
    logger.debug("{} stateTo() started. to:{}", objectName, nextState);
    SocketStateChangeResult stateChangeResult = state.to(nextState);
    if (stateChangeResult.isChange()) {
        executeChangeEventHandler(pinpointSocket, nextState);
    }
    logger.info("{} stateTo() completed. {}", objectName, stateChangeResult);
    return stateChangeResult;
}
Also used : PinpointSocket(com.navercorp.pinpoint.rpc.PinpointSocket) SocketStateChangeResult(com.navercorp.pinpoint.rpc.common.SocketStateChangeResult)

Example 3 with SocketStateChangeResult

use of com.navercorp.pinpoint.rpc.common.SocketStateChangeResult in project pinpoint by naver.

the class DefaultPinpointServer method handleClosePacket.

private void handleClosePacket(Channel channel) {
    logger.info("{} handleClosePacket() started.", objectUniqName);
    SocketStateChangeResult stateChangeResult = state.toBeingCloseByPeer();
    if (!stateChangeResult.isChange()) {
        logger.info("{} handleClosePacket() failed. Error: {}", objectUniqName, stateChangeResult);
    } else {
        logger.info("{} handleClosePacket() completed.", objectUniqName);
    }
}
Also used : SocketStateChangeResult(com.navercorp.pinpoint.rpc.common.SocketStateChangeResult)

Example 4 with SocketStateChangeResult

use of com.navercorp.pinpoint.rpc.common.SocketStateChangeResult in project pinpoint by naver.

the class DefaultPinpointServer method sendClosePacket.

public ChannelFuture sendClosePacket() {
    logger.info("{} sendClosePacket() started.", objectUniqName);
    SocketStateChangeResult stateChangeResult = state.toBeingClose();
    if (stateChangeResult.isChange()) {
        final ChannelFuture writeFuture = this.channel.write(ServerClosePacket.DEFAULT_SERVER_CLOSE_PACKET);
        writeFuture.addListener(serverCloseWriteListener);
        logger.info("{} sendClosePacket() completed.", objectUniqName);
        return writeFuture;
    } else {
        logger.info("{} sendClosePacket() failed. Error:{}.", objectUniqName, stateChangeResult);
        return null;
    }
}
Also used : ChannelFuture(org.jboss.netty.channel.ChannelFuture) SocketStateChangeResult(com.navercorp.pinpoint.rpc.common.SocketStateChangeResult)

Example 5 with SocketStateChangeResult

use of com.navercorp.pinpoint.rpc.common.SocketStateChangeResult in project pinpoint by naver.

the class DefaultPinpointServerState method to.

private SocketStateChangeResult to(SocketStateCode nextState) {
    String objectUniqName = pinpointServer.getObjectUniqName();
    logger.debug("{} stateTo() started. to:{}", objectUniqName, nextState);
    SocketStateChangeResult stateChangeResult = state.to(nextState);
    if (stateChangeResult.isChange()) {
        executeChangeEventHandler(pinpointServer, nextState);
    }
    logger.info("{} stateTo() completed. {}", objectUniqName, stateChangeResult);
    return stateChangeResult;
}
Also used : SocketStateChangeResult(com.navercorp.pinpoint.rpc.common.SocketStateChangeResult)

Aggregations

SocketStateChangeResult (com.navercorp.pinpoint.rpc.common.SocketStateChangeResult)6 PinpointSocket (com.navercorp.pinpoint.rpc.PinpointSocket)1 HashMap (java.util.HashMap)1 ChannelFuture (org.jboss.netty.channel.ChannelFuture)1