public abstract class RpcCommand extends Object implements RemotingCommand
| Constructor and Description |
|---|
RpcCommand() |
RpcCommand(byte type) |
RpcCommand(byte version,
byte type,
CommandCode cmdCode) |
RpcCommand(byte type,
CommandCode cmdCode) |
RpcCommand(CommandCode cmdCode) |
| Modifier and Type | Method and Description |
|---|---|
void |
deserialize()
Deserialize the class header and content.
|
void |
deserialize(long mask)
Deserialize according to mask.
|
void |
deserializeClazz()
Deserialize the content class.
|
void |
deserializeContent(InvokeContext invokeContext)
Deserialize the content.
|
void |
deserializeHeader(InvokeContext invokeContext)
Deserialize the header.
|
byte[] |
getClazz() |
short |
getClazzLength() |
CommandCode |
getCmdCode()
Get the command code for this command
|
byte[] |
getContent() |
int |
getContentLength() |
byte[] |
getHeader() |
short |
getHeaderLength() |
int |
getId()
Get the id of the command
|
InvokeContext |
getInvokeContext()
Get invoke context for this command
|
ProtocolCode |
getProtocolCode()
Get the code of the protocol that this command belongs to
|
ProtocolSwitch |
getProtocolSwitch()
Get the protocol switch status for this command
|
byte |
getSerializer()
Get serializer type for this command
|
byte |
getType() |
byte |
getVersion() |
void |
serialize()
Serialize the class header and content.
|
void |
serializeClazz()
Serialize content class.
|
void |
serializeContent(InvokeContext invokeContext)
Serialize the content.
|
void |
serializeHeader(InvokeContext invokeContext)
Serialize the header.
|
void |
setClazz(byte[] clazz) |
void |
setCmdCode(CommandCode cmdCode) |
void |
setContent(byte[] content) |
void |
setHeader(byte[] header) |
void |
setId(int id) |
void |
setInvokeContext(InvokeContext invokeContext) |
void |
setProtocolSwitch(ProtocolSwitch protocolSwitch) |
void |
setSerializer(byte serializer) |
void |
setType(byte type) |
void |
setVersion(byte version) |
public RpcCommand()
public RpcCommand(byte type)
public RpcCommand(CommandCode cmdCode)
public RpcCommand(byte type,
CommandCode cmdCode)
public RpcCommand(byte version,
byte type,
CommandCode cmdCode)
public void serialize()
throws SerializationException
serialize in interface RemotingCommandExceptionSerializationExceptionpublic void deserialize()
throws DeserializationException
deserialize in interface RemotingCommandExceptionDeserializationExceptionpublic void deserialize(long mask)
throws DeserializationException
RpcDeserializeLevel.DESERIALIZE_CLAZZ, only deserialize clazz - only one part.RpcDeserializeLevel.DESERIALIZE_HEADER, deserialize clazz and header - two parts.RpcDeserializeLevel.DESERIALIZE_ALL, deserialize clazz, header and content - all three parts.mask - CodecExceptionDeserializationExceptionpublic void serializeClazz()
throws SerializationException
ExceptionSerializationExceptionpublic void deserializeClazz()
throws DeserializationException
ExceptionDeserializationExceptionpublic void serializeHeader(InvokeContext invokeContext) throws SerializationException
ExceptionSerializationExceptionpublic void serializeContent(InvokeContext invokeContext) throws SerializationException
serializeContent in interface RemotingCommandExceptionSerializationExceptionpublic void deserializeHeader(InvokeContext invokeContext) throws DeserializationException
ExceptionDeserializationExceptionpublic void deserializeContent(InvokeContext invokeContext) throws DeserializationException
deserializeContent in interface RemotingCommandExceptionDeserializationExceptionpublic ProtocolCode getProtocolCode()
RemotingCommandgetProtocolCode in interface RemotingCommandpublic CommandCode getCmdCode()
RemotingCommandgetCmdCode in interface RemotingCommandpublic InvokeContext getInvokeContext()
RemotingCommandgetInvokeContext in interface RemotingCommandpublic byte getSerializer()
RemotingCommandgetSerializer in interface RemotingCommandpublic ProtocolSwitch getProtocolSwitch()
RemotingCommandgetProtocolSwitch in interface RemotingCommandpublic void setCmdCode(CommandCode cmdCode)
public byte getVersion()
public void setVersion(byte version)
public byte getType()
public void setType(byte type)
public void setSerializer(byte serializer)
public void setProtocolSwitch(ProtocolSwitch protocolSwitch)
public int getId()
RemotingCommandgetId in interface RemotingCommandpublic void setId(int id)
public byte[] getHeader()
public void setHeader(byte[] header)
public byte[] getContent()
public void setContent(byte[] content)
public short getHeaderLength()
public int getContentLength()
public short getClazzLength()
public byte[] getClazz()
public void setClazz(byte[] clazz)
public void setInvokeContext(InvokeContext invokeContext)
Copyright © 2024. All rights reserved.