spring-framework / org.springframework.messaging.simp / SimpAttributesContextHolder

SimpAttributesContextHolder

abstract class SimpAttributesContextHolder

Holder class to expose SiMP attributes associated with a session (e.g. WebSocket) in the form of a thread-bound SimpAttributes object.

Author
Rossen Stoyanchev

Since
4.1

Constructors

<init>

SimpAttributesContextHolder()

Holder class to expose SiMP attributes associated with a session (e.g. WebSocket) in the form of a thread-bound SimpAttributes object.

Functions

currentAttributes

open static fun currentAttributes(): SimpAttributes

Return the SimpAttributes currently bound to the thread or raise an java.lang.IllegalStateException if none are bound..

getAttributes

open static fun getAttributes(): SimpAttributes

Return the SimpAttributes currently bound to the thread.

resetAttributes

open static fun resetAttributes(): Unit

Reset the SimpAttributes for the current thread.

setAttributes

open static fun setAttributes(attributes: SimpAttributes): Unit

Bind the given SimpAttributes to the current thread,

setAttributesFromMessage

open static fun setAttributesFromMessage(message: Message<*>): Unit

Extract the SiMP session attributes from the given message, wrap them in a SimpAttributes instance and bind it to the current thread,