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, setBeanName
protected Serializer serializer
protected Encrypter encrypter
protected void init() throws Exception
BeanSupport
init
in class BeanSupport
Exception
public String encode(Map<String,Object> attrs, SessionStore.StoreContext storeContext) throws SessionEncoderException
encode
in interface SessionEncoder
SessionEncoderException
- 如果编码失败public Map<String,Object> decode(String encodedValue, SessionStore.StoreContext storeContext) throws SessionEncoderException
decode
in interface SessionEncoder
SessionEncoderException
- 如果解码失败public String toString()
BeanSupport
toString
in class BeanSupport
Copyright © 2006–2018 TinyGroup. All rights reserved.