Class ClusteredSessionImpl
- java.lang.Object
- 
- org.apache.tapestry5.http.internal.services.SessionImpl
- 
- org.apache.tapestry5.http.internal.services.ClusteredSessionImpl
 
 
- 
- All Implemented Interfaces:
- Session
 
 public class ClusteredSessionImpl extends SessionImpl A thin wrapper aroundHttpSessionthat supports re-storing of mutable session attributes at the end of the request (seerestoreDirtyObjects()). This is only used when clustering.- Since:
- 5.3
- See Also:
- SessionPersistedObjectAnalyzer
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.apache.tapestry5.http.services.SessionSession.LockMode
 
- 
 - 
Constructor SummaryConstructors Constructor Description ClusteredSessionImpl(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpSession session, SessionLock lock, SessionPersistedObjectAnalyzer analyzer)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectgetAttribute(java.lang.String name)Returns the value previously stored in the session.voidinvalidate()Invalidates this session then unbinds any objects bound to it.voidrestoreDirtyObjects()Re-stores dirty objects back into the session.voidsetAttribute(java.lang.String name, java.lang.Object value)Sets the value of an attribute.- 
Methods inherited from class org.apache.tapestry5.http.internal.services.SessionImplcontainsAttribute, containsAttribute, getAttribute, getAttributeNames, getAttributeNames, getAttributeNames, getAttributeNames, getMaxInactiveInterval, isInvalidated, setMaxInactiveInterval
 
- 
 
- 
- 
- 
Constructor Detail- 
ClusteredSessionImplpublic ClusteredSessionImpl(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpSession session, SessionLock lock, SessionPersistedObjectAnalyzer analyzer) 
 
- 
 - 
Method Detail- 
getAttributepublic java.lang.Object getAttribute(java.lang.String name) Description copied from interface:SessionReturns the value previously stored in the session.By default, a WRITElock is requested.- Specified by:
- getAttributein interface- Session
- Overrides:
- getAttributein class- SessionImpl
- Parameters:
- name- The name of the attribute
 
 - 
setAttributepublic void setAttribute(java.lang.String name, java.lang.Object value) Description copied from interface:SessionSets the value of an attribute. If the value isnull, then the attribute is deleted.- Specified by:
- setAttributein interface- Session
- Overrides:
- setAttributein class- SessionImpl
- Parameters:
- name- The name of the attribute
- value- The new value of the attribute;- nulldeletes the attribute.
 
 - 
invalidatepublic void invalidate() Description copied from interface:SessionInvalidates this session then unbinds any objects bound to it.- Specified by:
- invalidatein interface- Session
- Overrides:
- invalidatein class- SessionImpl
 
 - 
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
- Overrides:
- restoreDirtyObjectsin class- SessionImpl
- See Also:
- OptimizedSessionPersistedObject,- OptimizedSessionPersistedObjectAnalyzer,- ImmutableSessionPersistedObject
 
 
- 
 
-