Top Description Fields Constructors Methods
org.springframework.web.context.request

public abstract Class AbstractRequestAttributes

extends Object
implements RequestAttributes
Class Inheritance
All Implemented Interfaces
org.springframework.web.context.request.RequestAttributes
Known Direct Subclasses
org.springframework.web.context.request.ServletRequestAttributes
Imports
java.util.LinkedHashMap, .Map, org.springframework.util.Assert

Abstract support class for RequestAttributes implementations, offering a request completion mechanism for request-specific destruction callbacks and for updating accessed session attributes.
Author
Juergen Hoeller
Since
2.0
See Also
requestCompleted()

Field Summary

Modifier and TypeField and Description
private volatile boolean
protected final Map<String, Runnable>
requestDestructionCallbacks

Map from attribute name String to destruction callback Runnable.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
executeRequestDestructionCallbacks()

Execute all callbacks that have been registered for execution after request completion.

protected final boolean
isRequestActive()

Determine whether the original request is still active.

protected final void
registerRequestDestructionCallback(String
the name of the attribute to register the callback for
name
,
Runnable
the callback to be executed for destruction
callback
)

Register the given callback as to be executed after request completion.

protected final void
removeRequestDestructionCallback(String
the name of the attribute to remove the callback for
name
)

Remove the request destruction callback for the specified attribute, if any.

public void
requestCompleted()

Signal that the request has been completed.

protected 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.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

requestActiveback to summary
private volatile boolean requestActive
requestDestructionCallbacksback to summary
protected final Map<String, Runnable> requestDestructionCallbacks

Map from attribute name String to destruction callback Runnable.

Constructor Detail

AbstractRequestAttributesback to summary
public AbstractRequestAttributes()

Method Detail

executeRequestDestructionCallbacksback to summary
private void executeRequestDestructionCallbacks()

Execute all callbacks that have been registered for execution after request completion.

isRequestActiveback to summary
protected final boolean isRequestActive()

Determine whether the original request is still active.

See Also
requestCompleted()
registerRequestDestructionCallbackback to summary
protected final void registerRequestDestructionCallback(String name, Runnable callback)

Register the given callback as to be executed after request completion.

Parameters
name:String

the name of the attribute to register the callback for

callback:Runnable

the callback to be executed for destruction

removeRequestDestructionCallbackback to summary
protected final void removeRequestDestructionCallback(String name)

Remove the request destruction callback for the specified attribute, if any.

Parameters
name:String

the name of the attribute to remove the callback for

requestCompletedback to summary
public 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.

updateAccessedSessionAttributesback to summary
protected 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.