Class SessionImpl
- java.lang.Object
- 
- org.apache.tapestry5.http.internal.services.SessionImpl
 
- 
- All Implemented Interfaces:
- Session
 - Direct Known Subclasses:
- ClusteredSessionImpl
 
 public class SessionImpl extends Object implements Session A thin wrapper aroundHttpSession.
- 
- 
Constructor SummaryConstructors Constructor Description SessionImpl(HttpServletRequest request, HttpSession session, SessionLock lock)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetAttribute(String name)Returns the value previously stored in the session.List<String>getAttributeNames()Returns a list of the names of all attributes stored in the session.List<String>getAttributeNames(String prefix)Returns a list of the names of all attributes stored in the session whose name has the provided prefix.intgetMaxInactiveInterval()Returns the maximum time interval, in seconds, that the servlet container will keep this session open between client accesses.voidinvalidate()Invalidates this session then unbinds any objects bound to it.booleanisInvalidated()Checks to see if the session has been invalidated.voidrestoreDirtyObjects()Re-stores dirty objects back into the session.voidsetAttribute(String name, Object value)Sets the value of an attribute.voidsetMaxInactiveInterval(int seconds)Specifies the time, in seconds, between client requests before the servlet container will invalidate this session.
 
- 
- 
- 
Constructor Detail- 
SessionImplpublic SessionImpl(HttpServletRequest request, HttpSession session, SessionLock lock) 
 
- 
 - 
Method Detail- 
getAttributepublic Object getAttribute(String name) Description copied from interface:SessionReturns the value previously stored in the session.- Specified by:
- getAttributein interface- Session
 
 - 
getAttributeNamespublic List<String> getAttributeNames() Description copied from interface:SessionReturns a list of the names of all attributes stored in the session. The names are returned sorted alphabetically.- Specified by:
- getAttributeNamesin interface- Session
 
 - 
setAttributepublic void setAttribute(String name, Object value) Description copied from interface:SessionSets the value of an attribute. If the value is null, then the attribute is deleted.- Specified by:
- setAttributein interface- Session
 
 - 
getAttributeNamespublic List<String> getAttributeNames(String prefix) Description copied from interface:SessionReturns a list of the names of all attributes stored in the session whose name has the provided prefix. The names are returned in alphabetical order.- Specified by:
- getAttributeNamesin interface- Session
 
 - 
getMaxInactiveIntervalpublic int getMaxInactiveInterval() Description copied from interface:SessionReturns the maximum time interval, in seconds, that the servlet container will keep this session open between client accesses. After this interval, the servlet container will invalidate the session. The maximum time interval can be set with the setMaxInactiveInterval method. A negative time indicates the session should never timeout.- Specified by:
- getMaxInactiveIntervalin interface- Session
 
 - 
invalidatepublic void invalidate() Description copied from interface:SessionInvalidates this session then unbinds any objects bound to it.- Specified by:
- invalidatein interface- Session
 
 - 
isInvalidatedpublic boolean isInvalidated() Description copied from interface:SessionChecks to see if the session has been invalidated. Note: since 5.3 this will also catch calls toHttpSession.invalidate().- Specified by:
- isInvalidatedin interface- Session
 
 - 
setMaxInactiveIntervalpublic void setMaxInactiveInterval(int seconds) Description copied from interface:SessionSpecifies the time, in seconds, between client requests before the servlet container will invalidate this session. A negative time indicates the session should never timeout.- Specified by:
- setMaxInactiveIntervalin interface- Session
 
 - 
restoreDirtyObjectspublic void restoreDirtyObjects() Description copied from interface:SessionRe-stores dirty objects back into the session. This is necessary to support clustering, because (in most application servers) session objects are only broadcast around the cluster from setAttribute(). If a mutable session object is read and changed, those changes will be limited to a single server in the cluster, which can cause confusing application failures in the event of a failover. Does nothing if there are no changes, or the session has been invalidated.- Specified by:
- restoreDirtyObjectsin interface- Session
- See Also:
- OptimizedSessionPersistedObject,- OptimizedSessionPersistedObjectAnalyzer,- ImmutableSessionPersistedObject
 
 
- 
 
-