public class PrincipalThreadContextListener extends Object implements ThreadContextListener
ThreadContextListener that ensures the correct initialization of Principals when
working with non-container managed threads on all supported Cloud platforms.ThreadContextListener.DefaultPriorities| Modifier and Type | Field and Description |
|---|---|
static String |
PROPERTY_PRINCIPAL
The ThreadContext key.
|
| Constructor and Description |
|---|
PrincipalThreadContextListener()
Default constructor.
|
PrincipalThreadContextListener(Principal principal)
Constructor for providing a
Principal to be returned by this listener. |
| Modifier and Type | Method and Description |
|---|---|
void |
afterInitialize(ThreadContext threadContext,
ThreadContext parentThreadContext) |
void |
beforeDestroy(ThreadContext threadContext,
ThreadContext parentThreadContext) |
int |
getPriority() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitafterDestroy, beforeInitialize, compareTopublic static final String PROPERTY_PRINCIPAL
public PrincipalThreadContextListener()
public int getPriority()
getPriority in interface ThreadContextListenerpublic void afterInitialize(@Nonnull ThreadContext threadContext, @Nullable ThreadContext parentThreadContext)
afterInitialize in interface ThreadContextListenerpublic void beforeDestroy(@Nonnull ThreadContext threadContext, @Nullable ThreadContext parentThreadContext)
beforeDestroy in interface ThreadContextListenerCopyright © 2021 SAP SE. All rights reserved.