public abstract class AbstractProtocol extends Object implements Protocol
Protocol interface directly.| 限定符和类型 | 字段和说明 |
|---|---|
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,
BrpcChannel 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
|
boolean |
isCoexistence()
该协议是否可以和其他协议共存。
|
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 void beforeRequestSent(Request request, RpcClient rpcClient, BrpcChannel channelGroup)
ProtocolbeforeRequestSent 在接口中 Protocolpublic boolean returnChannelBeforeResponse()
ProtocolreturnChannelBeforeResponse 在接口中 Protocolpublic void afterResponseSent(Request request, Response response, io.netty.channel.ChannelFuture channelFuture)
ProtocolafterResponseSent 在接口中 ProtocolchannelFuture - the return value of writeAndFlushpublic boolean isCoexistence()
ProtocolisCoexistence 在接口中 ProtocolCopyright © 2019 Baidu, Inc.. All rights reserved.