Interface SessionCache

All Superinterfaces:
LifeCycle
All Known Implementing Classes:
AbstractSessionCache, DefaultSessionCache, NullSessionCache

public interface SessionCache extends LifeCycle
SessionCache A working set of Session objects for a context. Ideally, multiple requests for the same session id in the same context will always share the same Session object from the SessionCache, but it would be possible for implementations of SessionCache to create a fresh object for each request. The SessionData pertaining to the Session objects is obtained from/written to a SessionDataStore. The SessionDataStore is the authoritative source of session data:
  • if the session data is not present in the SessionDataStore the session does not exist.
  • if the session data is present in the SessionDataStore but its expiry time has passed then the session is deemed to have expired and is therefore invalid
A SessionCache can passivate a valid Session to the SessionDataStore and evict it from the cache according to various strategies:
  • whenever the last request exits a Session
  • whenever the Session has not been accessed for a configurable number of seconds
. Eviction can save memory, and can also help mitigate some of the problems of a non-sticky load balancer by forcing the session data to be re-read from the SessionDataStore more frequently.