Package org.apache.catalina.valves
Class PersistentValve
- java.lang.Object
- 
- org.apache.catalina.util.LifecycleBase
- 
- org.apache.catalina.util.LifecycleMBeanBase
- 
- org.apache.catalina.valves.ValveBase
- 
- org.apache.catalina.valves.PersistentValve
 
 
 
 
- 
- All Implemented Interfaces:
- javax.management.MBeanRegistration,- 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. - Author:
- Jean-Frederic Clere
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.apache.catalina.LifecycleLifecycle.SingleUse
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected java.util.regex.Patternfilter- 
Fields inherited from class org.apache.catalina.valves.ValveBaseasyncSupported, container, containerLog, next, sm
 - 
Fields inherited from class org.apache.catalina.util.LifecycleMBeanBasemserver
 - 
Fields inherited from interface org.apache.catalina.LifecycleAFTER_DESTROY_EVENT, AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_DESTROY_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT
 
- 
 - 
Constructor SummaryConstructors Constructor Description PersistentValve()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetFilter()voidinvoke(Request request, Response response)Select the appropriate child Context to process this request, based on the specified request URI.protected booleanisRequestWithoutSession(java.lang.String uri)protected booleanisSessionStale(Session session, long timeNow)Indicate whether the session has been idle for longer than its expiration date as of the supplied time.voidsetContainer(Container container)Set the Container with which this Valve is associated, if any.voidsetFilter(java.lang.String filter)- 
Methods inherited from class org.apache.catalina.valves.ValveBasebackgroundProcess, getContainer, getDomainInternal, getNext, getObjectNameKeyProperties, initInternal, isAsyncSupported, setAsyncSupported, setNext, startInternal, stopInternal, toString
 - 
Methods inherited from class org.apache.catalina.util.LifecycleMBeanBasedestroyInternal, getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister
 - 
Methods inherited from class org.apache.catalina.util.LifecycleBaseaddLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stop
 
- 
 
- 
- 
- 
Method Detail- 
setContainerpublic void setContainer(Container container) Description copied from class:ValveBaseSet the Container with which this Valve is associated, if any.- Specified by:
- setContainerin interface- Contained
- Overrides:
- setContainerin class- ValveBase
- Parameters:
- container- The new associated container
 
 - 
invokepublic void invoke(Request request, Response response) throws java.io.IOException, ServletException 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.- Parameters:
- request- Request to be processed
- response- Response to be produced
- Throws:
- java.io.IOException- if an input/output error occurred
- ServletException- if a servlet error occurred
 
 - 
isSessionStaleprotected 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.- Parameters:
- session- The session to check
- timeNow- The current time to check for
- Returns:
- trueif the session is past its expiration
 
 - 
isRequestWithoutSessionprotected boolean isRequestWithoutSession(java.lang.String uri) 
 - 
getFilterpublic java.lang.String getFilter() 
 - 
setFilterpublic void setFilter(java.lang.String filter) 
 
- 
 
-