Issue #6752 - Extensible DefaultSessionCache map implementation
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
This commit is contained in:
parent
7301efdc80
commit
8788aaef5a
|
@ -28,7 +28,7 @@ import org.slf4j.LoggerFactory;
|
|||
/**
|
||||
* DefaultSessionCache
|
||||
*
|
||||
* A session store that keeps its sessions in memory in a concurrent map
|
||||
* A session store that keeps its sessions in memory within a concurrent map
|
||||
*/
|
||||
@ManagedObject
|
||||
public class DefaultSessionCache extends AbstractSessionCache
|
||||
|
@ -38,7 +38,7 @@ public class DefaultSessionCache extends AbstractSessionCache
|
|||
/**
|
||||
* The cache of sessions in a concurrent map
|
||||
*/
|
||||
protected ConcurrentMap<String, Session> _sessions = new ConcurrentHashMap<>();
|
||||
private final ConcurrentMap<String, Session> _sessions;
|
||||
|
||||
private final CounterStatistic _stats = new CounterStatistic();
|
||||
|
||||
|
@ -46,8 +46,18 @@ public class DefaultSessionCache extends AbstractSessionCache
|
|||
* @param manager The SessionHandler related to this SessionCache
|
||||
*/
|
||||
public DefaultSessionCache(SessionHandler manager)
|
||||
{
|
||||
this(manager, new ConcurrentHashMap<>());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param manager The SessionHandler related to this SessionCache
|
||||
* @param sessionMap The session map implementation to use
|
||||
*/
|
||||
public DefaultSessionCache(SessionHandler manager, ConcurrentMap<String, Session> sessionMap)
|
||||
{
|
||||
super(manager);
|
||||
this._sessions = sessionMap;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue