Skip to content

Commit

Permalink
Issue #6752 - Extensible DefaultSessionCache map implementation
Browse files Browse the repository at this point in the history
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
  • Loading branch information
joakime committed Sep 15, 2021
1 parent 7301efd commit 8788aae
Showing 1 changed file with 12 additions and 2 deletions.
Expand Up @@ -28,7 +28,7 @@
/**
* 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
Expand All @@ -38,16 +38,26 @@ 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();

/**
* @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;
}

/**
Expand Down

0 comments on commit 8788aae

Please sign in to comment.