Class TenantThreadContextListener
java.lang.Object
com.sap.cloud.sdk.cloudplatform.tenant.TenantThreadContextListener
- All Implemented Interfaces:
ThreadContextListener
,Comparable<ThreadContextListener>
Implementation of
ThreadContextListener
that ensures the correct initialization of Tenant
s when
working with non-container managed threads on all supported Cloud platforms.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.sap.cloud.sdk.cloudplatform.thread.ThreadContextListener
ThreadContextListener.DefaultPriorities
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.TenantThreadContextListener
(Tenant tenant) Constructor for providing aTenant
to be returned by this listener. -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterInitialize
(ThreadContext threadContext) Invoked after the currentThreadContext
is initialized and set.int
Returns the priority that defines the order in which listeners are invoked.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.sap.cloud.sdk.cloudplatform.thread.ThreadContextListener
beforeInitialize, compareTo
-
Field Details
-
PROPERTY_TENANT
The ThreadContext key.
-
-
Constructor Details
-
Method Details
-
getPriority
public int getPriority()Description copied from interface:ThreadContextListener
Returns the priority that defines the order in which listeners are invoked. Smaller priorities are invoked earlier during context initialization and invoked later (reversed initialization order) during context destruction. Negative number must not be used as they are reserved for internal use.- Specified by:
getPriority
in interfaceThreadContextListener
- Returns:
- The priority of this listener implementation.
-
afterInitialize
Description copied from interface:ThreadContextListener
Invoked after the currentThreadContext
is initialized and set.- Specified by:
afterInitialize
in interfaceThreadContextListener
- Parameters:
threadContext
- TheThreadContext
that was initialized is now set.
-