Return the best available mutex for the given request attributes:
that is, an object to synchronize on for the given request attributes.
Returns the request attributes mutex attribute if available; usually,
this means that the RequestAttributeMutexListener needs to be defined
in web.xml. Falls back to the ServletRequest itself
if no mutex attribute found.
The request attributes mutex is guaranteed to be the same object during
the entire lifetime of the request, available under the key defined
by the REQUEST_MUTEX_ATTRIBUTE constant. It serves as a
safe reference to synchronize on for locking on the current request attributes.
- Parameters:
servletRequest - the ServletRequest to find a mutex for
- Returns:
- the mutex object (never
null) - See Also:
REQUEST_MUTEX_ATTRIBUTE,
RequestAttributeMutexListener