本文整理了Java中com.weibo.yar.YarRequest.getPackagerName()
方法的一些代码示例,展示了YarRequest.getPackagerName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YarRequest.getPackagerName()
方法的具体详情如下:
包路径:com.weibo.yar.YarRequest
类名称:YarRequest
方法名:getPackagerName
暂无
代码示例来源: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
@Override
public Object handle(Channel channel, Object message) {
YarRequest yarRequest = (YarRequest) message;
String packagerName = yarRequest.getPackagerName();
Provider<?> provider = providerMap.get(yarRequest.getRequestPath());
if (provider == null) {
throw new MotanServiceException("can not find service provider. request path:" + yarRequest.getRequestPath());
}
Class<?> clazz = provider.getInterface();
Request request = YarProtocolUtil.convert(yarRequest, clazz);
Response response = call(request, provider);
YarResponse yarResponse = YarProtocolUtil.convert(response, packagerName);
return yarResponse;
}
代码示例来源: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;
}
内容来源于网络,如有侵权,请联系作者删除!