Class PersistentValve

  • All Implemented Interfaces:, Contained, JmxEnabled, Lifecycle, Valve

    public class PersistentValve
    extends ValveBase
    Valve that implements per-request session persistence. It is intended to be used with non-sticky load-balancers.

    USAGE CONSTRAINT: To work correctly it requires a PersistentManager.

    USAGE CONSTRAINT: To work correctly it assumes only one request exists per session at any one time.

    Jean-Frederic Clere
    • Field Detail

      • filter

        protected java.util.regex.Pattern filter
    • Constructor Detail

      • PersistentValve

        public PersistentValve()
    • Method Detail

      • setContainer

        public void setContainer​(Container container)
        Description copied from class: ValveBase
        Set the Container with which this Valve is associated, if any.
        Specified by:
        setContainer in interface Contained
        setContainer in class ValveBase
        container - The new associated container
      • invoke

        public void invoke​(Request request,
                           Response response)
        Select the appropriate child Context to process this request, based on the specified request URI. If no matching Context can be found, return an appropriate HTTP error.
        request - Request to be processed
        response - Response to be produced
        Throws: - if an input/output error occurred
        ServletException - if a servlet error occurred
      • isSessionStale

        protected boolean isSessionStale​(Session session,
                                         long timeNow)
        Indicate whether the session has been idle for longer than its expiration date as of the supplied time. FIXME: Probably belongs in the Session class.
        session - The session to check
        timeNow - The current time to check for
        true if the session is past its expiration
      • isRequestWithoutSession

        protected boolean isRequestWithoutSession​(java.lang.String uri)
      • getFilter

        public java.lang.String getFilter()
      • setFilter

        public void setFilter​(java.lang.String filter)