java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.session.AbstractSessionManager
org.eclipse.jetty.ee10.servlet.SessionHandler
- All Implemented Interfaces:
org.eclipse.jetty.server.Handler,org.eclipse.jetty.server.Handler.Container,org.eclipse.jetty.server.Handler.Singleton,org.eclipse.jetty.server.Request.Handler,org.eclipse.jetty.session.SessionConfig,org.eclipse.jetty.session.SessionConfig.Mutable,org.eclipse.jetty.session.SessionManager,org.eclipse.jetty.util.component.Container,org.eclipse.jetty.util.component.Destroyable,org.eclipse.jetty.util.component.Dumpable,org.eclipse.jetty.util.component.Dumpable.DumpableContainer,org.eclipse.jetty.util.component.LifeCycle,org.eclipse.jetty.util.thread.Invocable
public class SessionHandler
extends org.eclipse.jetty.session.AbstractSessionManager
implements org.eclipse.jetty.server.Handler.Singleton
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classCookieConfig Implementation of the jakarta.servlet.SessionCookieConfig.static classNested classes/interfaces inherited from class org.eclipse.jetty.session.AbstractSessionManager
org.eclipse.jetty.session.AbstractSessionManager.RequestedSessionNested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
org.eclipse.jetty.util.component.Dumpable.DumpableContainerNested classes/interfaces inherited from interface org.eclipse.jetty.server.Handler
org.eclipse.jetty.server.Handler.Abstract, org.eclipse.jetty.server.Handler.AbstractContainer, org.eclipse.jetty.server.Handler.Collection, org.eclipse.jetty.server.Handler.Container, org.eclipse.jetty.server.Handler.Sequence, org.eclipse.jetty.server.Handler.Singleton, org.eclipse.jetty.server.Handler.WrapperNested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.Invocable
org.eclipse.jetty.util.thread.Invocable.Callable, org.eclipse.jetty.util.thread.Invocable.InvocationType, org.eclipse.jetty.util.thread.Invocable.ReadyTask, org.eclipse.jetty.util.thread.Invocable.TaskNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
org.eclipse.jetty.util.component.LifeCycle.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.server.Request.Handler
org.eclipse.jetty.server.Request.Handler.AbortExceptionNested classes/interfaces inherited from interface org.eclipse.jetty.session.SessionConfig
org.eclipse.jetty.session.SessionConfig.Mutable -
Field Summary
FieldsFields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
FAILED, STARTED, STARTING, STOPPED, STOPPINGFields inherited from interface org.eclipse.jetty.util.component.Dumpable
KEYFields inherited from interface org.eclipse.jetty.util.thread.Invocable
__nonBlocking, NOOPFields inherited from interface org.eclipse.jetty.session.SessionConfig
__CheckRemoteSessionEncodingProperty, __DefaultSessionCookie, __DefaultSessionDomain, __DefaultSessionIdPathParameterName, __MaxAgeProperty, __SessionCookieProperty, __SessionDomainProperty, __SessionIdPathParameterNameProperty, __SessionPathProperty -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddEventListener(EventListener listener) Adds an event listener for session-related events.protected voidcallBoundBindingListener(org.eclipse.jetty.server.Session session, String name, Object value) protected voidcallUnboundBindingListener(org.eclipse.jetty.server.Session session, String name, Object value) protected voidSet up cookie configuration based on init paramsvoiddoStart()Set<jakarta.servlet.SessionTrackingMode> Set<jakarta.servlet.SessionTrackingMode> org.eclipse.jetty.server.Handlerorg.eclipse.jetty.util.thread.Invocable.InvocationTypeorg.eclipse.jetty.session.ManagedSessiongetManagedSession(org.eclipse.jetty.server.Request request) org.eclipse.jetty.http.HttpCookie.SameSiteorg.eclipse.jetty.server.Serverjakarta.servlet.SessionCookieConfigbooleanhandle(org.eclipse.jetty.server.Request request, org.eclipse.jetty.server.Response response, org.eclipse.jetty.util.Callback callback) org.eclipse.jetty.server.Session.APInewSessionAPIWrapper(org.eclipse.jetty.session.ManagedSession session) voidonSessionActivation(org.eclipse.jetty.server.Session session) voidonSessionAttributeUpdate(org.eclipse.jetty.server.Session session, String name, Object old, Object value) voidonSessionCreated(org.eclipse.jetty.server.Session session) Call the session lifecycle listeners in the order they were added.voidonSessionDestroyed(org.eclipse.jetty.server.Session session) Call the session lifecycle listeners in the reverse order they were added.voidonSessionIdChanged(org.eclipse.jetty.server.Session session, String oldId) voidonSessionPassivation(org.eclipse.jetty.server.Session session) booleanremoveEventListener(EventListener listener) voidsetHandler(org.eclipse.jetty.server.Handler handler) voidsetSameSite(org.eclipse.jetty.http.HttpCookie.SameSite sameSite) Set Session cookie sameSite mode.voidsetServer(org.eclipse.jetty.server.Server server) voidsetSessionTrackingModes(Set<jakarta.servlet.SessionTrackingMode> sessionTrackingModes) Methods inherited from class org.eclipse.jetty.session.AbstractSessionManager
access, addSessionStreamWrapper, calculateInactivityTimeout, commit, complete, doStop, encodeURI, getContext, getManagedSession, getMaxCookieAge, getMaxInactiveInterval, getRefreshCookieAge, getSessionCache, getSessionComment, getSessionContext, getSessionCookie, getSessionCookie, getSessionCookieAttribute, getSessionCookieAttributes, getSessionDomain, getSessionIdManager, getSessionIdPathParameterName, getSessionIdPathParameterNamePrefix, getSessionPath, getSessionsCreated, getSessionTimeMean, getSessionTimeStdDev, getSessionTimeTotal, invalidate, isCheckingRemoteSessionIdEncoding, isHttpOnly, isIdInUse, isPartitioned, isSecureCookies, isSecureRequestOnly, isUsingCookies, isUsingUriParameters, isUsingURLs, newSession, newSessionInactivityTimer, recordSessionTime, renewSessionId, resolveRequestedSessionId, scavenge, sessionTimerExpired, setCheckingRemoteSessionIdEncoding, setHttpOnly, setMaxCookieAge, setMaxInactiveInterval, setPartitioned, setRefreshCookieAge, setSecureCookies, setSecureRequestOnly, setSessionCache, setSessionComment, setSessionCookie, setSessionCookieAttribute, setSessionDomain, setSessionIdManager, setSessionIdPathParameterName, setSessionPath, setUsingCookies, setUsingUriParameters, setUsingURLsMethods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addManaged, contains, destroy, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, installBean, installBean, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeansMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.component.Container
getCachedBeans, getEventListenersMethods inherited from interface org.eclipse.jetty.util.component.Destroyable
destroyMethods inherited from interface org.eclipse.jetty.util.component.Dumpable
dumpSelfMethods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpableMethods inherited from interface org.eclipse.jetty.server.Handler.Container
getContainer, getDescendant, getDescendants, getDescendantsMethods inherited from interface org.eclipse.jetty.server.Handler.Singleton
getHandlers, getTail, insertHandler, setHandlerMethods inherited from interface org.eclipse.jetty.util.component.LifeCycle
isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, start, stop
-
Field Details
-
DEFAULT_SESSION_TRACKING_MODES
-
-
Constructor Details
-
SessionHandler
public SessionHandler()
-
-
Method Details
-
setServer
public void setServer(org.eclipse.jetty.server.Server server) - Specified by:
setServerin interfaceorg.eclipse.jetty.server.Handler
-
getInvocationType
public org.eclipse.jetty.util.thread.Invocable.InvocationType getInvocationType()- Specified by:
getInvocationTypein interfaceorg.eclipse.jetty.util.thread.Invocable- Specified by:
getInvocationTypein interfaceorg.eclipse.jetty.server.Request.Handler
-
getHandler
public org.eclipse.jetty.server.Handler getHandler()- Specified by:
getHandlerin interfaceorg.eclipse.jetty.server.Handler.Singleton
-
setHandler
public void setHandler(org.eclipse.jetty.server.Handler handler) - Specified by:
setHandlerin interfaceorg.eclipse.jetty.server.Handler.Singleton
-
getServer
public org.eclipse.jetty.server.Server getServer()- Specified by:
getServerin interfaceorg.eclipse.jetty.server.Handler- Specified by:
getServerin classorg.eclipse.jetty.session.AbstractSessionManager
-
getManagedSession
public org.eclipse.jetty.session.ManagedSession getManagedSession(org.eclipse.jetty.server.Request request) - Specified by:
getManagedSessionin interfaceorg.eclipse.jetty.session.SessionManager
-
addEventListener
Adds an event listener for session-related events.- Specified by:
addEventListenerin interfaceorg.eclipse.jetty.util.component.Container- Specified by:
addEventListenerin interfaceorg.eclipse.jetty.util.component.LifeCycle- Overrides:
addEventListenerin classorg.eclipse.jetty.util.component.ContainerLifeCycle- Parameters:
listener- the session event listener to add Individual SessionManagers implementations may accept arbitrary listener types, but they are expected to at least handle HttpSessionActivationListener, HttpSessionAttributeListener, HttpSessionBindingListener and HttpSessionListener.- Returns:
- true if the listener was added
- See Also:
-
removeEventListener
- Specified by:
removeEventListenerin interfaceorg.eclipse.jetty.util.component.Container- Specified by:
removeEventListenerin interfaceorg.eclipse.jetty.util.component.LifeCycle- Overrides:
removeEventListenerin classorg.eclipse.jetty.util.component.ContainerLifeCycle
-
doStart
-
configureCookies
protected void configureCookies()Set up cookie configuration based on init params -
newSessionAPIWrapper
public org.eclipse.jetty.server.Session.API newSessionAPIWrapper(org.eclipse.jetty.session.ManagedSession session) - Specified by:
newSessionAPIWrapperin interfaceorg.eclipse.jetty.session.SessionManager
-
onSessionAttributeUpdate
-
onSessionCreated
public void onSessionCreated(org.eclipse.jetty.server.Session session) Call the session lifecycle listeners in the order they were added.- Specified by:
onSessionCreatedin interfaceorg.eclipse.jetty.session.SessionManager- Overrides:
onSessionCreatedin classorg.eclipse.jetty.session.AbstractSessionManager- Parameters:
session- the session on which to call the lifecycle listeners
-
onSessionDestroyed
public void onSessionDestroyed(org.eclipse.jetty.server.Session session) Call the session lifecycle listeners in the reverse order they were added.- Specified by:
onSessionDestroyedin interfaceorg.eclipse.jetty.session.SessionManager- Overrides:
onSessionDestroyedin classorg.eclipse.jetty.session.AbstractSessionManager- Parameters:
session- the session on which to call the lifecycle listeners
-
onSessionIdChanged
- Specified by:
onSessionIdChangedin interfaceorg.eclipse.jetty.session.SessionManager- Overrides:
onSessionIdChangedin classorg.eclipse.jetty.session.AbstractSessionManager
-
callUnboundBindingListener
-
callBoundBindingListener
-
onSessionActivation
public void onSessionActivation(org.eclipse.jetty.server.Session session) - Specified by:
onSessionActivationin interfaceorg.eclipse.jetty.session.SessionManager
-
onSessionPassivation
public void onSessionPassivation(org.eclipse.jetty.server.Session session) - Specified by:
onSessionPassivationin interfaceorg.eclipse.jetty.session.SessionManager
-
getSessionCookieConfig
public jakarta.servlet.SessionCookieConfig getSessionCookieConfig() -
getDefaultSessionTrackingModes
-
getEffectiveSessionTrackingModes
-
getSameSite
public org.eclipse.jetty.http.HttpCookie.SameSite getSameSite()- Specified by:
getSameSitein interfaceorg.eclipse.jetty.session.SessionConfig- Overrides:
getSameSitein classorg.eclipse.jetty.session.AbstractSessionManager
-
setSameSite
public void setSameSite(org.eclipse.jetty.http.HttpCookie.SameSite sameSite) Set Session cookie sameSite mode. In ee10 this is set as a generic session cookie attribute.- Specified by:
setSameSitein interfaceorg.eclipse.jetty.session.SessionConfig.Mutable- Overrides:
setSameSitein classorg.eclipse.jetty.session.AbstractSessionManager- Parameters:
sameSite- The sameSite setting for Session cookies (or null for no sameSite setting)
-
setSessionTrackingModes
-
handle
-