@Extension(value="hessian2", code=1) public class SofaHessianSerializer extends AbstractSerializer
Encode: : Support MessageLite, String, SofaRequest and SofaResponse.
Decode by class mode : Support MessageLite and String.
Decode by object template : Support SofaRequest and SofaResponse.
| 限定符和类型 | 字段和说明 |
|---|---|
protected com.caucho.hessian.io.SerializerFactory |
genericSerializerFactory
Generic Serializer Factory
|
protected com.caucho.hessian.io.SerializerFactory |
serializerFactory
Normal Serializer Factory
|
| 构造器和说明 |
|---|
SofaHessianSerializer()
Instantiates a new Sofa hessian serializer.
|
| 限定符和类型 | 方法和说明 |
|---|---|
Object |
decode(AbstractByteBuf data,
Class clazz,
Map<String,String> context)
反序列化,只有类型,返回对象
|
void |
decode(AbstractByteBuf data,
Object template,
Map<String,String> context)
反序列化,已有数据,填充字段
|
protected SofaRequest |
decodeSofaRequest(AbstractByteBuf data,
Map<String,String> context)
Do decode SofaRequest
|
protected void |
decodeSofaRequestByTemplate(AbstractByteBuf data,
Map<String,String> context,
SofaRequest template)
Do decode SofaRequest
|
protected SofaResponse |
decodeSofaResponse(AbstractByteBuf data,
Map<String,String> context)
Do decode SofaResponse
|
protected void |
decodeSofaResponseByTemplate(AbstractByteBuf data,
Map<String,String> context,
SofaResponse template)
Do decode SofaResponse
|
AbstractByteBuf |
encode(Object object,
Map<String,String> context)
序列化
|
protected AbstractByteBuf |
encodeSofaRequest(SofaRequest sofaRequest,
Map<String,String> context)
Do encode SofaRequest
|
protected AbstractByteBuf |
encodeSofaResponse(SofaResponse response,
Map<String,String> context)
Do encode SofaResponse
|
protected com.caucho.hessian.io.SerializerFactory |
getSerializerFactory(boolean multipleClassLoader,
boolean generic)
Gets serializer factory.
|
protected boolean |
isGenericRequest(String serializeType)
Is generic request boolean.
|
protected boolean |
isGenericResponse(String serializeType)
Is generic response boolean.
|
buildDeserializeError, buildDeserializeError, buildSerializeError, buildSerializeErrorprotected com.caucho.hessian.io.SerializerFactory serializerFactory
protected com.caucho.hessian.io.SerializerFactory genericSerializerFactory
public SofaHessianSerializer()
protected com.caucho.hessian.io.SerializerFactory getSerializerFactory(boolean multipleClassLoader,
boolean generic)
multipleClassLoader - the multiple class loadergeneric - the genericpublic AbstractByteBuf encode(Object object, Map<String,String> context)
Serializerobject - 对象context - 上下文protected AbstractByteBuf encodeSofaRequest(SofaRequest sofaRequest, Map<String,String> context)
sofaRequest - 请求context - 上下文protected AbstractByteBuf encodeSofaResponse(SofaResponse response, Map<String,String> context)
response - 响应context - 上下文public Object decode(AbstractByteBuf data, Class clazz, Map<String,String> context) throws SofaRpcException
Serializerdata - 原始字节数组clazz - 期望的类型context - 上下文SofaRpcException - 序列化异常public void decode(AbstractByteBuf data, Object template, Map<String,String> context) throws SofaRpcException
Serializerdata - 原始字节数组template - 模板对象context - 上下文SofaRpcException - 序列化异常protected SofaRequest decodeSofaRequest(AbstractByteBuf data, Map<String,String> context) throws SofaRpcException
data - AbstractByteBufcontext - 上下文SofaRpcException - 序列化出现异常protected void decodeSofaRequestByTemplate(AbstractByteBuf data, Map<String,String> context, SofaRequest template) throws SofaRpcException
data - AbstractByteBufcontext - 上下文template - SofaRequest templateSofaRpcException - 序列化出现异常protected SofaResponse decodeSofaResponse(AbstractByteBuf data, Map<String,String> context) throws SofaRpcException
data - AbstractByteBufcontext - 上下文SofaRpcException - 序列化出现异常protected void decodeSofaResponseByTemplate(AbstractByteBuf data, Map<String,String> context, SofaResponse template) throws SofaRpcException
data - AbstractByteBufcontext - 上下文template - SofaResponse templateSofaRpcException - 序列化出现异常protected boolean isGenericRequest(String serializeType)
serializeType - the serialize typeprotected boolean isGenericResponse(String serializeType)
serializeType - the serialize typeCopyright © 2008–2018 The Ant Financial. All rights reserved.