com.alipay.remoting.rpc.protocol
Class RpcProtocol

java.lang.Object
  extended by com.alipay.remoting.rpc.protocol.RpcProtocol
All Implemented Interfaces:
Protocol

public class RpcProtocol
extends Object
implements Protocol

Request command protocol for v1 0 1 2 4 6 8 10 12 14 16 +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ |proto| type| cmdcode |ver2 | requestId |codec| timeout | classLen | +-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+ |headerLen | contentLen | ... ... | +-----------+-----------+-----------+ + | className + header + content bytes | + + | ... ... | +-----------------------------------------------------------------------------------------------+ proto: code 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 headerLen: length of header contentLen: length of content Response command protocol for v1 0 1 2 3 4 6 8 10 12 14 16 +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ |proto| type| cmdcode |ver2 | requestId |codec|respstatus | classLen |headerLen | +-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+ | contentLen | ... ... | +-----------------------+ + | className + header + content bytes | + + | ... ... | +-----------------------------------------------------------------------------------------------+ respstatus: response status


Field Summary
static byte PROTOCOL_CODE
           
 
Constructor Summary
RpcProtocol()
           
 
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()
          Get the length of request header.
static int getResponseHeaderLength()
          Get the length of response header.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROTOCOL_CODE

public static final byte PROTOCOL_CODE
See Also:
Constant Field Values
Constructor Detail

RpcProtocol

public RpcProtocol()
Method Detail

getRequestHeaderLength

public static int getRequestHeaderLength()
Get the length of request header.

Returns:

getResponseHeaderLength

public static int getResponseHeaderLength()
Get the length of response header.

Returns:

getEncoder

public CommandEncoder getEncoder()
Description copied from interface: Protocol
Get the encoder for the protocol.

Specified by:
getEncoder in interface Protocol
Returns:

getDecoder

public CommandDecoder getDecoder()
Description copied from interface: Protocol
Get the decoder for the protocol.

Specified by:
getDecoder in interface Protocol
Returns:

getHeartbeatTrigger

public HeartbeatTrigger getHeartbeatTrigger()
Description copied from interface: Protocol
Get the heartbeat trigger for the protocol.

Specified by:
getHeartbeatTrigger in interface Protocol
Returns:

getCommandHandler

public CommandHandler getCommandHandler()
Description copied from interface: Protocol
Get the command handler for the protocol.

Specified by:
getCommandHandler in interface Protocol
Returns:

getCommandFactory

public CommandFactory getCommandFactory()
Description copied from interface: Protocol
Get the command factory for the protocol.

Specified by:
getCommandFactory in interface Protocol
Returns:


Copyright © 2018. All rights reserved.