public abstract class AbstractSerializationEncoder extends BeanSupport implements SessionEncoder
Serializer提供的序列化机制来编码对象,以及解码字符串。
编码步骤为:
Serializer序列化,默认使用HessianSerializer。Encrypter存在,用它加密,否则,不加密。解码步骤相反。
| Modifier and Type | Field and Description |
|---|---|
protected Encrypter |
encrypter |
protected Serializer |
serializer |
| Constructor and Description |
|---|
AbstractSerializationEncoder() |
| Modifier and Type | Method and Description |
|---|---|
Map<String,Object> |
decode(String encodedValue,
SessionStore.StoreContext storeContext)
解码。
|
String |
encode(Map<String,Object> attrs,
SessionStore.StoreContext storeContext)
编码。
|
protected void |
init()
初始化bean。
|
String |
toString()
转换成字符串。
|
afterPropertiesSet, assertInitialized, destroy, dispose, getBeanDescription, getBeanDescription, getBeanInterface, getBeanName, isInitialized, postDispose, postInit, preDispose, preInit, resolveBeanInterface, setBeanNameprotected Serializer serializer
protected Encrypter encrypter
protected void init()
throws Exception
BeanSupportinit in class BeanSupportExceptionpublic String encode(Map<String,Object> attrs, SessionStore.StoreContext storeContext) throws SessionEncoderException
encode in interface SessionEncoderSessionEncoderException - 如果编码失败public Map<String,Object> decode(String encodedValue, SessionStore.StoreContext storeContext) throws SessionEncoderException
decode in interface SessionEncoderSessionEncoderException - 如果解码失败public String toString()
BeanSupporttoString in class BeanSupportCopyright © 2006–2018 TinyGroup. All rights reserved.