public class RequestThreadContextListener extends Object implements ThreadContextListener
ThreadContextListener
that ensures that the current
HttpServletRequest
ThreadContextListener.DefaultPriorities
Modifier and Type | Field and Description |
---|---|
static String |
PROPERTY_REQUEST
The ThreadContext key.
|
Constructor and Description |
---|
RequestThreadContextListener(javax.servlet.http.HttpServletRequest request) |
Modifier and Type | Method and Description |
---|---|
void |
beforeDestroy(ThreadContext threadContext,
ThreadContext parentThreadContext)
Invoked before the current
ThreadContext is destroyed and reset. |
void |
beforeInitialize(ThreadContext threadContext,
ThreadContext parentThreadContext)
Invoked before the current
ThreadContext is initialized and set. |
int |
getPriority()
Returns the priority that defines the order in which listeners are invoked.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
afterDestroy, afterInitialize, compareTo
public static final String PROPERTY_REQUEST
public RequestThreadContextListener(@Nonnull javax.servlet.http.HttpServletRequest request)
public int getPriority()
getPriority
in interface ThreadContextListener
public void beforeInitialize(@Nonnull ThreadContext threadContext, @Nullable ThreadContext parentThreadContext)
ThreadContext
is initialized and set. This method can be used, for example, to
inherit properties from the parent context.beforeInitialize
in interface ThreadContextListener
threadContext
- The ThreadContext
that is initialized and will be set.parentThreadContext
- The existing parent ThreadContext
, or null
if there is currently no
ThreadContext
.public void beforeDestroy(@Nonnull ThreadContext threadContext, @Nullable ThreadContext parentThreadContext)
ThreadContext
is destroyed and reset.beforeDestroy
in interface ThreadContextListener
threadContext
- The ThreadContext
that is destroyed and will be removed.parentThreadContext
- The parent ThreadContext
, or null
if there is no parent ThreadContext
.Copyright © 2021 SAP SE. All rights reserved.