public interface RequestContext
RequestContextServletFilter
. In case an instance is required outside the normal servlet lifecycle (e.g.
within background tasks), refer to RequestContextExecutor
.RequestContextListener
Modifier and Type | Method and Description |
---|---|
Optional<Property<?>> |
getProperty(String name)
Retrieves the property for the given name.
|
Optional<javax.servlet.http.HttpServletRequest> |
getRequest() |
long |
getRequestThreadId() |
Optional<Property<?>> |
removeProperty(String name)
Removes the property with the given name.
|
void |
setPropertyIfAbsent(String name,
Property<?> value)
Sets a value for the property for the given name, if it has not been set before.
|
@Nonnull Optional<javax.servlet.http.HttpServletRequest> getRequest()
HttpServletRequest
of this instance, if present. Can be absent if the RequestContext
has been created by a RequestContextExecutor
when running outside the normal servlet lifecycle
(e.g. within background tasks).long getRequestThreadId()
@Nonnull Optional<Property<?>> getProperty(@Nonnull String name) throws RequestContextPropertyException
RequestContextPropertyException
- If there is an issue while accessing the property or if the property has a different type than the
one that is provided.void setPropertyIfAbsent(@Nonnull String name, @Nonnull Property<?> value) throws RequestContextPropertyException
RequestContextPropertyException
- If there is an issue while setting the property.@Nonnull Optional<Property<?>> removeProperty(@Nonnull String name) throws RequestContextPropertyException
Caution: Implementations may not be thread-safe!
RequestContextPropertyException
- If there is an issue while removing the property.Copyright © 2019 SAP SE. All rights reserved.