Class SecurityContextHolderThreadLocalAccessor
java.lang.Object
org.springframework.security.core.context.SecurityContextHolderThreadLocalAccessor
- All Implemented Interfaces:
io.micrometer.context.ThreadLocalAccessor<SecurityContext>
public final class SecurityContextHolderThreadLocalAccessor
extends Object
implements io.micrometer.context.ThreadLocalAccessor<SecurityContext>
A
ThreadLocalAccessor for accessing a SecurityContext with the
SecurityContextHolder.
This class adapts the SecurityContextHolder to the ThreadLocalAccessor
contract to allow Micrometer Context Propagation to automatically propagate a
SecurityContext in Servlet applications. It is automatically registered with
the ContextRegistry through the
ServiceLoader mechanism when context-propagation is on the classpath.
- Since:
- 6.5
- See Also:
-
ContextRegistry
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetValue()key()voidsetValue()voidsetValue(SecurityContext securityContext) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micrometer.context.ThreadLocalAccessor
reset, restore, restore
-
Constructor Details
-
SecurityContextHolderThreadLocalAccessor
public SecurityContextHolderThreadLocalAccessor()
-
-
Method Details
-
key
- Specified by:
keyin interfaceio.micrometer.context.ThreadLocalAccessor<SecurityContext>
-
getValue
- Specified by:
getValuein interfaceio.micrometer.context.ThreadLocalAccessor<SecurityContext>
-
setValue
- Specified by:
setValuein interfaceio.micrometer.context.ThreadLocalAccessor<SecurityContext>
-
setValue
public void setValue()- Specified by:
setValuein interfaceio.micrometer.context.ThreadLocalAccessor<SecurityContext>
-