クラス SimpAttributesContextHolder

java.lang.ObjectSE
org.springframework.messaging.simp.SimpAttributesContextHolder

public abstract class SimpAttributesContextHolder extends ObjectSE
セッション(WebSocket など)に関連付けられた SiMP 属性をスレッドバインド SimpAttributes オブジェクトの形式で公開するホルダークラス。
導入:
4.1
作成者:
Rossen Stoyanchev
  • コンストラクターの詳細

    • SimpAttributesContextHolder

      public SimpAttributesContextHolder()
  • メソッドの詳細

    • resetAttributes

      public static void resetAttributes()
      現在のスレッドの SimpAttributes をリセットします。
    • setAttributes

      public static void setAttributes(@Nullable SimpAttributes attributes)
      指定された SimpAttributes を現在のスレッドにバインドします。
      パラメーター:
      attributes - 公開する RequestAttributes
    • setAttributesFromMessage

      public static void setAttributesFromMessage(Message<?> message)
      指定されたメッセージから SiMP セッション属性を抽出し、SimpAttributes インスタンスにラップして、現在のスレッドにバインドします。
      パラメーター:
      message - セッション属性を抽出するメッセージ
    • getAttributes

      @Nullable public static SimpAttributes getAttributes()
      現在スレッドにバインドされている SimpAttributes を返します。
      戻り値:
      属性、またはバインドされていない場合は null 
    • currentAttributes

      public static SimpAttributes currentAttributes() throws IllegalStateExceptionSE
      現在スレッドにバインドされている SimpAttributes を返すか、バインドされていない場合は IllegalStateExceptionSE を発生させます。
      戻り値:
      属性、null
      例外:
      IllegalStateExceptionSE - 属性がバインドされていない場合