Class AbstractRequestAttributes
java.lang.Object
org.springframework.web.context.request.AbstractRequestAttributes
- All Implemented Interfaces:
- RequestAttributes
- Direct Known Subclasses:
- ServletRequestAttributes
Abstract support class for RequestAttributes implementations,
 offering a request completion mechanism for request-specific destruction
 callbacks and for updating accessed session attributes.
- Since:
- 2.0
- Author:
- Juergen Hoeller
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionMap from attribute name String to destruction callback Runnable.Fields inherited from interface org.springframework.web.context.request.RequestAttributesREFERENCE_REQUEST, REFERENCE_SESSION, SCOPE_REQUEST, SCOPE_SESSION
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected final booleanDetermine whether the original request is still active.protected final voidregisterRequestDestructionCallback(String name, Runnable callback) Register the given callback as to be executed after request completion.protected final voidRemove the request destruction callback for the specified attribute, if any.voidSignal that the request has been completed.protected abstract voidUpdate all session attributes that have been accessed during request processing, to expose their potentially updated state to the underlying session manager.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.web.context.request.RequestAttributesgetAttribute, getAttributeNames, getSessionId, getSessionMutex, registerDestructionCallback, removeAttribute, resolveReference, setAttribute
- 
Field Details- 
requestDestructionCallbacksMap from attribute name String to destruction callback Runnable.
 
- 
- 
Constructor Details- 
AbstractRequestAttributespublic AbstractRequestAttributes()
 
- 
- 
Method Details- 
requestCompletedpublic void requestCompleted()Signal that the request has been completed.Executes all request destruction callbacks and updates the session attributes that have been accessed during request processing. 
- 
isRequestActiveprotected final boolean isRequestActive()Determine whether the original request is still active.- See Also:
 
- 
registerRequestDestructionCallbackRegister the given callback as to be executed after request completion.- Parameters:
- name- the name of the attribute to register the callback for
- callback- the callback to be executed for destruction
 
- 
removeRequestDestructionCallbackRemove the request destruction callback for the specified attribute, if any.- Parameters:
- name- the name of the attribute to remove the callback for
 
- 
updateAccessedSessionAttributesprotected abstract void updateAccessedSessionAttributes()Update all session attributes that have been accessed during request processing, to expose their potentially updated state to the underlying session manager.
 
-