本文整理了Java中com.weibo.yar.YarRequest.getId()
方法的一些代码示例,展示了YarRequest.getId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YarRequest.getId()
方法的具体详情如下:
包路径:com.weibo.yar.YarRequest
类名称:YarRequest
方法名:getId
暂无
代码示例来源:origin: weibocom/motan
public AttachmentRequest(YarRequest yarRequest, Map<String, String> attachments) {
this(yarRequest.getId(), yarRequest.getPackagerName(), yarRequest.getMethodName(), yarRequest.getParameters());
this.attachments = attachments;
}
代码示例来源:origin: weibocom/motan
/**
* convert yar request to motan rpc request
*
* @param yarRequest
* @param interfaceClass
* @return
*/
public static Request convert(YarRequest yarRequest, Class<?> interfaceClass) {
DefaultRequest request = new DefaultRequest();
request.setInterfaceName(interfaceClass.getName());
request.setMethodName(yarRequest.getMethodName());
request.setRequestId(yarRequest.getId());
addArguments(request, interfaceClass, yarRequest.getMethodName(), yarRequest.getParameters());
if (yarRequest instanceof AttachmentRequest) {
request.setAttachments(((AttachmentRequest) yarRequest).getAttachments());
}
return request;
}
代码示例来源:origin: com.weibo/yar-java
public static byte[] toProtocolBytes(YarRequest request) throws IOException {
if (request == null) {
throw new YarException("YarRequest is null");
}
Map<String, Object> requestMap = new HashMap<String, Object>();
requestMap.put("i", request.getId());
requestMap.put("m", request.getMethodName());
requestMap.put("p", Arrays.asList(request.getParameters()));
String packagerName = request.getPackagerName();
return toProtocolBytes(request.getId(), packagerName, requestMap);
}
代码示例来源:origin: com.weibo/yar-java
private YarResponse process(YarRequest request) {
YarResponse response = new YarResponse();
response.setId(request.getId());
response.setPackagerName(request.getPackagerName());
JSONObject jo = new JSONObject();
jo.put("key", "test");
response.setRet(jo);
return response;
}
内容来源于网络,如有侵权,请联系作者删除!