org.eclipse.jetty.server.session

## Class SessionHandler

- java.lang.Object
- - org.eclipse.jetty.util.component.AbstractLifeCycle
  - - org.eclipse.jetty.util.component.AggregateLifeCycle
    - - org.eclipse.jetty.server.handler.AbstractHandler
      - - org.eclipse.jetty.server.handler.AbstractHandlerContainer
        - - org.eclipse.jetty.server.handler.HandlerWrapper
          - - org.eclipse.jetty.server.handler.ScopedHandler
            - - org.eclipse.jetty.server.session.SessionHandler

- All Implemented Interfaces:
    Handler, HandlerContainer, Destroyable, Dumpable, LifeCycle

      public class SessionHandler
      extends ScopedHandler

  SessionHandler.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

      `AbstractLifeCycle.AbstractLifeCycleListener`

    - ### Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle

      `LifeCycle.Listener`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static EnumSet<javax.servlet.SessionTrackingMode>` | `DEFAULT_TRACKING`

    - ### Fields inherited from class org.eclipse.jetty.server.handler.ScopedHandler

      `_nextScope, _outerScope`

    - ### Fields inherited from class org.eclipse.jetty.server.handler.HandlerWrapper

      `_handler`

    - ### Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

      `_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SessionHandler()` Constructor.
    `SessionHandler(SessionManager manager)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addEventListener(EventListener listener)`
    `protected void` | `checkRequestedSessionId(Request baseRequest, javax.servlet.http.HttpServletRequest request)` Look for a requested session ID in cookies and URI parameters
    `void` | `clearEventListeners()`
    `void` | `doHandle(String target, Request baseRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)`
    `void` | `doScope(String target, Request baseRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)`
    `protected void` | `doStart()` Start the managed lifecycle beans in the order they were added.
    `protected void` | `doStop()` Stop the joined lifecycle beans in the reverse order they were added.
    `SessionManager` | `getSessionManager()`
    `void` | `setServer(Server server)`
    `void` | `setSessionManager(SessionManager sessionManager)`

    - ### Methods inherited from class org.eclipse.jetty.server.handler.ScopedHandler

      `handle, never, nextHandle, nextScope`

    - ### Methods inherited from class org.eclipse.jetty.server.handler.HandlerWrapper

      `destroy, expandChildren, getHandler, getHandlers, getNestedHandlerByClass, setHandler`

    - ### Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandlerContainer

      `dump, expandHandler, findContainerOf, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass`

    - ### Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandler

      `dumpThis, getServer`

    - ### Methods inherited from class org.eclipse.jetty.util.component.AggregateLifeCycle

      `addBean, addBean, contains, dump, dump, dump, dump, dumpObject, dumpStdErr, getBean, getBeans, getBeans, isManaged, manage, removeBean, removeBeans, unmanage`

    - ### Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

      `addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle

      `addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop`

- - ### Field Detail

    - #### DEFAULT_TRACKING

          public static final EnumSet<javax.servlet.SessionTrackingMode> DEFAULT_TRACKING

  - ### Constructor Detail

    - #### SessionHandler

          public SessionHandler()

      Constructor. Construct a SessionHandler witha a HashSessionManager with a standard java.util.Random generator is created.

    - #### SessionHandler

          public SessionHandler(SessionManager manager)

      Parameters:
        `manager` - The session manager

  - ### Method Detail

    - #### getSessionManager

          public SessionManager getSessionManager()

      Returns:
        Returns the sessionManager.

    - #### setSessionManager

          public void setSessionManager(SessionManager sessionManager)

      Parameters:
        `sessionManager` - The sessionManager to set.

    - #### setServer

          public void setServer(Server server)

      Specified by:
        `setServer` in interface `Handler`
      Overrides:
        `setServer` in class `HandlerWrapper`

    - #### doStart

          protected void doStart()
                          throws Exception

      Description copied from class: `AggregateLifeCycle`
      Start the managed lifecycle beans in the order they were added.
      Overrides:
        `doStart` in class `ScopedHandler`
      Throws:
        `Exception`
      See Also:
        `HandlerWrapper.doStart()`

    - #### doStop

          protected void doStop()
                         throws Exception

      Description copied from class: `AggregateLifeCycle`
      Stop the joined lifecycle beans in the reverse order they were added.
      Overrides:
        `doStop` in class `HandlerWrapper`
      Throws:
        `Exception`
      See Also:
        `AbstractLifeCycle.doStart()`

    - #### doScope

          public void doScope(String target,
                     Request baseRequest,
                     javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)
                       throws IOException,
                              javax.servlet.ServletException

      Specified by:
        `doScope` in class `ScopedHandler`
      Throws:
        `IOException`
        `javax.servlet.ServletException`

    - #### doHandle

          public void doHandle(String target,
                      Request baseRequest,
                      javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response)
                        throws IOException,
                               javax.servlet.ServletException

      Specified by:
        `doHandle` in class `ScopedHandler`
      Throws:
        `IOException`
        `javax.servlet.ServletException`

    - #### checkRequestedSessionId

          protected void checkRequestedSessionId(Request baseRequest,
                                     javax.servlet.http.HttpServletRequest request)

      Look for a requested session ID in cookies and URI parameters
      Parameters:
        `baseRequest` -
        `request` -

    - #### addEventListener

          public void addEventListener(EventListener listener)

      Parameters:
        `listener` -

    - #### clearEventListeners

          public void clearEventListeners()

Copyright © 1995-2012 Mort Bay Consulting. All Rights Reserved.