クラス SimpAttributesContextHolder
java.lang.ObjectSE
org.springframework.messaging.simp.SimpAttributesContextHolder
セッション(WebSocket など)に関連付けられた SiMP 属性をスレッドバインド
SimpAttributes
オブジェクトの形式で公開するホルダークラス。- 導入:
- 4.1
- 作成者:
- Rossen Stoyanchev
コンストラクターの概要
コンストラクターメソッドのサマリー
修飾子と型メソッド説明static SimpAttributes
現在スレッドにバインドされている SimpAttributes を返すか、バインドされていない場合はIllegalStateException
SE を発生させます。static SimpAttributes
現在スレッドにバインドされている SimpAttributes を返します。static void
現在のスレッドの SimpAttributes をリセットします。static void
setAttributes
(SimpAttributes attributes) 指定された SimpAttributes を現在のスレッドにバインドします。static void
setAttributesFromMessage
(Message<?> message) 指定されたメッセージから SiMP セッション属性を抽出し、SimpAttributes
インスタンスにラップして、現在のスレッドにバインドします。
コンストラクターの詳細
SimpAttributesContextHolder
public SimpAttributesContextHolder()
メソッドの詳細
resetAttributes
public static void resetAttributes()現在のスレッドの SimpAttributes をリセットします。setAttributes
指定された SimpAttributes を現在のスレッドにバインドします。- パラメーター:
attributes
- 公開する RequestAttributes
setAttributesFromMessage
指定されたメッセージから SiMP セッション属性を抽出し、SimpAttributes
インスタンスにラップして、現在のスレッドにバインドします。- パラメーター:
message
- セッション属性を抽出するメッセージ
getAttributes
現在スレッドにバインドされている SimpAttributes を返します。- 戻り値:
- 属性、またはバインドされていない場合は
null
currentAttributes
現在スレッドにバインドされている SimpAttributes を返すか、バインドされていない場合はIllegalStateException
SE を発生させます。- 戻り値:
- 属性、
null
- 例外:
IllegalStateExceptionSE
- 属性がバインドされていない場合