Skip to content
This repository was archived by the owner on Feb 18, 2024. It is now read-only.

Commit 984c650

Browse files
committed
using hessian to serialize and deserialize
1 parent 82a0bed commit 984c650

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

sofa-serverless-runtime/sofa-serverless-common/pom.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@
4242
<groupId>com.caucho</groupId>
4343
<artifactId>hessian</artifactId>
4444
</dependency>
45-
<dependency>
46-
<groupId>com.alibaba</groupId>
47-
<artifactId>fastjson</artifactId>
48-
</dependency>
4945
<dependency>
5046
<groupId>junit</groupId>
5147
<artifactId>junit</artifactId>

sofa-serverless-runtime/sofa-serverless-common/src/main/java/com/alipay/sofa/serverless/common/util/SerializeUtils.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
*/
1717
package com.alipay.sofa.serverless.common.util;
1818

19-
import com.alibaba.fastjson.JSONObject;
2019
import com.caucho.hessian.io.Hessian2Input;
2120
import com.caucho.hessian.io.Hessian2Output;
2221
import com.caucho.hessian.io.SerializerFactory;
@@ -39,9 +38,7 @@ public static Object serializeTransform(Object source, ClassLoader targetClassLo
3938
Thread.currentThread().setContextClassLoader(targetClassLoader);
4039
}
4140

42-
// 使用 fastjson 将 source 序列化为 byte 数组,饭后又反序列化回来
43-
// return JSONObject.parseObject(JSONObject.toJSONString(source), source.getClass());
44-
41+
// 支持多态的序列化与反序列化,需要使用 hessian
4542
SerializerFactory serializerFactory = new SerializerFactory();
4643
serializerFactory.setAllowNonSerializable(true);
4744
ByteArrayOutputStream bos = new ByteArrayOutputStream();

0 commit comments

Comments
 (0)