MCPcopy Index your code
hub / github.com/apache/tomcat / createSession

Method createSession

java/org/apache/catalina/session/ManagerBase.java:715–743  ·  view source on GitHub ↗
(String sessionId)

Source from the content-addressed store, hash-verified

713
714
715 @Override
716 public Session createSession(String sessionId) {
717
718 if ((maxActiveSessions >= 0) && (getActiveSessions() >= maxActiveSessions)) {
719 rejectedSessions++;
720 throw new TooManyActiveSessionsException(sm.getString("managerBase.createSession.ise"), maxActiveSessions);
721 }
722
723 // Recycle or create a Session instance
724 Session session = createEmptySession();
725
726 // Initialize the properties of the new session and return it
727 session.setNew(true);
728 session.setValid(true);
729 session.setCreationTime(System.currentTimeMillis());
730 session.setMaxInactiveInterval(getContext().getSessionTimeout() * 60);
731 String id = sessionId;
732 if (id == null) {
733 id = generateSessionId();
734 }
735 session.setId(id);
736
737 SessionTiming timing = new SessionTiming(session.getCreationTime(), 0);
738 synchronized (sessionCreationTiming) {
739 sessionCreationTiming.add(timing);
740 sessionCreationTiming.poll();
741 }
742 return session;
743 }
744
745
746 @Override

Callers

nothing calls this directly

Calls 14

getActiveSessionsMethod · 0.95
createEmptySessionMethod · 0.95
setNewMethod · 0.95
setValidMethod · 0.95
setCreationTimeMethod · 0.95
getContextMethod · 0.95
generateSessionIdMethod · 0.95
setIdMethod · 0.95
getCreationTimeMethod · 0.95
getStringMethod · 0.65
getSessionTimeoutMethod · 0.65

Tested by

no test coverage detected