接口 SessionPersister
- 所有已知实现类:
FileSessionPersister
public interface SessionPersister
A SessionPersister that provides persistent storage and loading
of Sessions and their associated user data.
Implementations are free to save and load the Sessions to any media they
wish, but it is assumed that saved Sessions are persistent across
server or context restarts.
- 从以下版本开始:
- 4.0 2023/2/26 23:04
- 作者:
- Harry Yang
-
方法概要
修饰符和类型方法说明voidclear()Remove all Sessions from this Store.booleancontains session with given idString[]keys()Load and return the Session associated with the specified session identifier from this Store, without removing it.voidRemove the Session with the specified session identifier from this Store, if present.voidsave(WebSession session) Save the specified Session into this Store.
-
方法详细资料
-
clear
Remove all Sessions from this Store.- 抛出:
IOException- if an input/output error occurs
-
remove
Remove the Session with the specified session identifier from this Store, if present. If no such Session is present, this method takes no action.- 参数:
id- Session identifier of the Session to be removed- 抛出:
IOException
-
contains
contains session with given id -
keys
String[] keys()- 返回:
- an array containing the session identifiers of all Sessions currently saved in this Store. If there are no such Sessions, a zero-length array is returned.
-
load
Load and return the Session associated with the specified session identifier from this Store, without removing it. If there is no such stored Session, returnnull.- 参数:
id- Session identifier of the session to load- 返回:
- the loaded Session instance
- 抛出:
ClassNotFoundException- if a deserialization error occursIOException- if an input/output error occurs
-
save
Save the specified Session into this Store. Any previously saved information for the associated session identifier is replaced.- 参数:
session- Session to be saved- 抛出:
IOException- if an input/output error occurs
-