Skip to content

Commit

Permalink
Issue #6752 - Extensible DefaultSessionCache map implementation
Browse files Browse the repository at this point in the history
Addressing changes requested from review

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
  • Loading branch information
joakime committed Sep 15, 2021
1 parent 8788aae commit 8991b7f
Showing 1 changed file with 11 additions and 3 deletions.
Expand Up @@ -13,6 +13,7 @@

package org.eclipse.jetty.server.session;

import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.function.Function;
Expand Down Expand Up @@ -52,12 +53,12 @@ public DefaultSessionCache(SessionHandler manager)

/**
* @param manager The SessionHandler related to this SessionCache
* @param sessionMap The session map implementation to use
* @param sessions The session map implementation to use
*/
public DefaultSessionCache(SessionHandler manager, ConcurrentMap<String, Session> sessionMap)
public DefaultSessionCache(SessionHandler manager, ConcurrentMap<String, Session> sessions)
{
super(manager);
this._sessions = sessionMap;
_sessions = Objects.requireNonNull(sessions, "Session Map may not be null");
}

/**
Expand Down Expand Up @@ -194,4 +195,11 @@ public boolean doReplace(String id, Session oldValue, Session newValue)
{
return _sessions.replace(id, oldValue, newValue);
}

@Override
protected void doStart() throws Exception
{
Objects.requireNonNull(_sessions, "Session Map may not be null");
super.doStart();
}
}

0 comments on commit 8991b7f

Please sign in to comment.