use of com.navercorp.pinpoint.rpc.common.SocketStateChangeResult in project pinpoint by naver.
the class DefaultPinpointClientHandler method channelConnected.
@Override
public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
Channel channel = ctx.getChannel();
if ((null == channel) || (this.channel != channel)) {
throw new IllegalArgumentException("Invalid channel variable. this.channel:" + this.channel + ", channel:" + channel + ".");
}
logger.info("{} channelConnected() started. channel:{}", objectUniqName, channel);
SocketStateChangeResult stateChangeResult = state.toConnected();
if (!stateChangeResult.isChange()) {
throw new IllegalStateException("Invalid state:" + stateChangeResult.getCurrentState());
}
prepareChannel(channel);
stateChangeResult = state.toRunWithoutHandshake();
if (!stateChangeResult.isChange()) {
throw new IllegalStateException("Failed to execute channelConnected() method. Error:" + stateChangeResult);
}
registerPing();
Map<String, Object> handshakeData = new HashMap<String, Object>();
handshakeData.putAll(clientFactory.getProperties());
handshakeData.put("socketId", socketId);
if (localClusterOption.isEnable()) {
handshakeData.put("cluster", localClusterOption.getProperties());
}
handshaker.handshakeStart(channel, handshakeData);
connectFuture.setResult(Result.SUCCESS);
logger.info("{} channelConnected() completed.", objectUniqName);
}
Aggregations