public interface InternalSessionManager
限定符和类型 | 方法和说明 |
---|---|
void |
add(InternalSession session)
Add this Session to the set of active Sessions for this Manager.
|
void |
backgroundProcess()
Implements the Manager interface, direct call to processExpires
|
InternalSession |
createEmptySession()
Get a session from the recycled ones or create a new empty one.
|
InternalSession |
createSession(String sessionId)
Construct and return a new session object, based on the default
settings specified by this Manager's properties.
|
InternalSession |
findSession(String id)
Return the active Session, associated with this Manager, with the
specified session id (if any); otherwise return
null . |
InternalSession[] |
findSessions() |
int |
getActiveSessions()
Returns the number of active sessions
|
void |
remove(InternalSession session)
Remove this Session from the active Sessions for this Manager.
|
void |
remove(InternalSession session,
boolean update)
Remove this Session from the active Sessions for this Manager.
|
void |
setBackgroundProcessorDelay(int backgroundProcessorDelay)
Set the manager background processor delay
设置manager sleep几秒,尝试执行一次background操作(清理过期session)
|
void |
setMaxActiveSessions(int max)
Set the maximum number of active Sessions allowed, or -1 for
no limit.
|
void |
setMaxInactiveInterval(int interval)
Set the default maximum inactive interval (in seconds)
for Sessions created by this Manager.
|
void |
setProcessExpiresFrequency(int processExpiresFrequency)
Set the manager checks frequency.
|
InternalSession findSession(String id)
null
.id
- The session id for the session to be returnedIllegalStateException
- if a new session cannot be
instantiated for any reasonIOException
- if an input/output error occurs while
processing this requestInternalSession createSession(String sessionId)
null
.sessionId
- The session id which should be used to create the
new session; if null
, a new session id will be
generatedIllegalStateException
- if a new session cannot be
instantiated for any reasonvoid remove(InternalSession session)
session
- Session to be removedvoid remove(InternalSession session, boolean update)
session
- Session to be removedupdate
- Should the expiration statistics be updatedvoid add(InternalSession session)
session
- Session to be addedint getActiveSessions()
InternalSession createEmptySession()
InternalSession[] findSessions()
void backgroundProcess()
void setMaxInactiveInterval(int interval)
interval
- The new default valuevoid setProcessExpiresFrequency(int processExpiresFrequency)
Set the manager checks frequency.
设置每尝试多少次清理过期session,才真的会执行一次清理动作
要和setBackgroundProcessorDelay(int)
联合起来看
如果把这个数字设置为6(默认),那么就是说manager要等待 6 * backgroundProcessorDay的时间才会清理过期session
processExpiresFrequency
- the new manager checks frequencyvoid setBackgroundProcessorDelay(int backgroundProcessorDelay)
Set the manager background processor delay 设置manager sleep几秒,尝试执行一次background操作(清理过期session)
backgroundProcessorDelay
- void setMaxActiveSessions(int max)
max
- The new maximum number of sessionsCopyright © 2024. All rights reserved.