RpcConfig.java 文件源码

java
阅读 22 收藏 0 点赞 0 评论 0

项目:dremio-oss 作者:
public boolean checkResponseSend(EnumLite responseType, Class<?> responseClass) {
  if (RpcConstants.EXTRA_DEBUGGING) {
    logger.debug(String.format("Checking responce send of type %s with response class of %s.",  responseType, responseClass));
  }
  RpcMessageType<?,?,?> type = receiveMap.get(responseType.getNumber());
  if (type == null) {
    throw new IllegalStateException(String.format("%s: There is no defined RpcMessage type for a Rpc response of type %s.", name, responseType));
  }
  if (type.getRet() != responseClass) {
    throw new IllegalStateException(String.format("%s: The definition for the response doesn't match implementation code.  The definition is %s however the current response is trying to response with an object of type %s.", name, type, responseClass.getCanonicalName()));
  }

  return true;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号