| 限定符和类型 | 字段和说明 |
|---|---|
protected static NotEnoughDataException |
notEnoughDataException |
| 构造器和说明 |
|---|
AbstractProtocol() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
afterResponseSent(Request request,
Response response,
io.netty.channel.ChannelFuture channelFuture)
do something if needed after server channel writeAndFlush
|
void |
beforeRequestSent(Request request,
RpcClient rpcClient,
BrpcChannelGroup channelGroup)
do something if needed before client send request
|
Request |
createRequest()
create a new request instance
|
Response |
createResponse()
create a new response instance
|
Request |
getRequest()
get a reusable request instance from threadLocal or pool
the request instance must be reset before reuse
|
Response |
getResponse()
get a reusable response instance from threadLocal or pool
the response instance must be reset before reuse
|
Request |
initRequest(RpcClient rpcClient,
Map<String,RpcMethodInfo> rpcMethodMap,
Object instance,
Method method,
Object[] args)
初始化请求
|
boolean |
returnChannelBeforeResponse()
连接被归还入池的时机
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdecode, decodeRequest, decodeResponse, encodeRequest, encodeResponseprotected static NotEnoughDataException notEnoughDataException
public Request createRequest()
ProtocolcreateRequest 在接口中 Protocolpublic Response createResponse()
ProtocolcreateResponse 在接口中 Protocolpublic Request getRequest()
ProtocolgetRequest 在接口中 Protocolpublic Response getResponse()
ProtocolgetResponse 在接口中 Protocolpublic Request initRequest(RpcClient rpcClient, Map<String,RpcMethodInfo> rpcMethodMap, Object instance, Method method, Object[] args)
ProtocolinitRequest 在接口中 ProtocolrpcClient - 客户端rpcMethodMap - rpc方法元信息instance - 调用者实例method - 被调用的方法args - 方法参数public void beforeRequestSent(Request request, RpcClient rpcClient, BrpcChannelGroup channelGroup)
ProtocolbeforeRequestSent 在接口中 Protocolpublic boolean returnChannelBeforeResponse()
ProtocolreturnChannelBeforeResponse 在接口中 Protocolpublic void afterResponseSent(Request request, Response response, io.netty.channel.ChannelFuture channelFuture)
ProtocolafterResponseSent 在接口中 ProtocolchannelFuture - the return value of writeAndFlushCopyright © 2019 Baidu, Inc.. All rights reserved.