|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.alipay.remoting.rpc.protocol.RpcProtocolV2
public class RpcProtocolV2
Request command protocol for v2 0 1 2 4 6 8 10 11 12 14 16 +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+------+-----+-----+-----+-----+ |proto| ver1|type | cmdcode |ver2 | requestId |codec|switch| timeout | +-----------+-----------+-----------+-----------+-----------+------------+-----------+-----------+ |classLen |headerLen |contentLen | ... | +-----------+-----------+-----------+-----------+ + | className + header + content bytes | + + | ... ... | CRC32(optional) | +------------------------------------------------------------------------------------------------+ proto: code for protocol ver1: version for protocol type: request/response/request oneway cmdcode: code for remoting command ver2:version for remoting command requestId: id of request codec: code for codec switch: function switch for protocol headerLen: length of header contentLen: length of content CRC32: CRC32 of the frame(Exists when ver1 > 1) Response command protocol for v2 0 1 2 3 4 6 8 10 11 12 14 16 +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+------+-----+-----+-----+-----+ |proto| ver1| type| cmdcode |ver2 | requestId |codec|switch|respstatus | classLen | +-----------+-----------+-----------+-----------+-----------+------------+-----------+-----------+ |headerLen | contentLen | ... | +-----------------------------------+ + | className + header + content bytes | + + | ... ... | CRC32(optional) | +------------------------------------------------------------------------------------------------+ respstatus: response status
| Field Summary | |
|---|---|
static byte |
PROTOCOL_CODE
|
static byte |
PROTOCOL_VERSION_1
version 1, is the same with RpcProtocol |
static byte |
PROTOCOL_VERSION_2
version 2, is the protocol version for RpcProtocolV2 |
| Constructor Summary | |
|---|---|
RpcProtocolV2()
|
|
| Method Summary | |
|---|---|
CommandFactory |
getCommandFactory()
Get the command factory for the protocol. |
CommandHandler |
getCommandHandler()
Get the command handler for the protocol. |
CommandDecoder |
getDecoder()
Get the decoder for the protocol. |
CommandEncoder |
getEncoder()
Get the encoder for the protocol. |
HeartbeatTrigger |
getHeartbeatTrigger()
Get the heartbeat trigger for the protocol. |
static int |
getRequestHeaderLength()
|
static int |
getResponseHeaderLength()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final byte PROTOCOL_CODE
public static final byte PROTOCOL_VERSION_1
public static final byte PROTOCOL_VERSION_2
| Constructor Detail |
|---|
public RpcProtocolV2()
| Method Detail |
|---|
public static int getRequestHeaderLength()
public static int getResponseHeaderLength()
public CommandEncoder getEncoder()
Protocol
getEncoder in interface Protocolpublic CommandDecoder getDecoder()
Protocol
getDecoder in interface Protocolpublic HeartbeatTrigger getHeartbeatTrigger()
Protocol
getHeartbeatTrigger in interface Protocolpublic CommandHandler getCommandHandler()
Protocol
getCommandHandler in interface Protocolpublic CommandFactory getCommandFactory()
Protocol
getCommandFactory in interface Protocol
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||