public class CTPMapSessionRepository extends Object implements org.springframework.session.SessionRepository<org.springframework.session.ExpiringSession>
SessionRepository
backed by a Map
and that uses a MapSession
. By default a
ConcurrentHashMap
is used, but a custom Map
can be injected to use
distributed maps provided by NoSQL stores like Redis and Hazelcast.
The implementation does NOT support firing SessionDestroyedEvent
.
构造器和说明 |
---|
CTPMapSessionRepository()
Creates an instance backed by a
ConcurrentHashMap |
CTPMapSessionRepository(Map<String,org.springframework.session.ExpiringSession> sessions)
Creates a new instance backed by the provided
Map . |
限定符和类型 | 方法和说明 |
---|---|
org.springframework.session.ExpiringSession |
createSession() |
void |
delete(String id) |
org.springframework.session.ExpiringSession |
getSession(String id) |
void |
save(org.springframework.session.ExpiringSession session) |
void |
setDefaultMaxInactiveInterval(int defaultMaxInactiveInterval)
If non-null, this value is used to override
ExpiringSession.setMaxInactiveIntervalInSeconds(int) . |
public CTPMapSessionRepository()
ConcurrentHashMap
public void setDefaultMaxInactiveInterval(int defaultMaxInactiveInterval)
ExpiringSession.setMaxInactiveIntervalInSeconds(int)
.defaultMaxInactiveInterval
- the number of seconds that the Session
should be kept alive between client requests.public void save(org.springframework.session.ExpiringSession session)
save
在接口中 org.springframework.session.SessionRepository<org.springframework.session.ExpiringSession>
public org.springframework.session.ExpiringSession getSession(String id)
getSession
在接口中 org.springframework.session.SessionRepository<org.springframework.session.ExpiringSession>
public void delete(String id)
delete
在接口中 org.springframework.session.SessionRepository<org.springframework.session.ExpiringSession>
public org.springframework.session.ExpiringSession createSession()
createSession
在接口中 org.springframework.session.SessionRepository<org.springframework.session.ExpiringSession>
Copyright © 2016–2017. All rights reserved.