クラス ConcurrentWebSocketSessionDecorator

java.lang.ObjectSE
org.springframework.web.socket.handler.WebSocketSessionDecorator
org.springframework.web.socket.handler.ConcurrentWebSocketSessionDecorator
実装済みのインターフェース一覧:
CloseableSE, AutoCloseableSE, WebSocketSession

public class ConcurrentWebSocketSessionDecorator extends WebSocketSessionDecorator
WebSocketSession をラップして、一度に 1 つのスレッドのみがメッセージを送信できるようにします。

send が遅い場合、他のスレッドからさらにメッセージを送信しようとしてもフラッシュロックを取得できず、代わりにメッセージはバッファリングされます。その際、指定されたバッファサイズ制限と送信時間制限がチェックされ、制限を超えた場合はセッションが閉じられます。

導入:
4.0.3
作成者:
Rossen Stoyanchev, Juergen Hoeller
  • コンストラクターの詳細

    • ConcurrentWebSocketSessionDecorator

      public ConcurrentWebSocketSessionDecorator(WebSocketSession delegate, int sendTimeLimit, int bufferSizeLimit)
      基本コンストラクター。
      パラメーター:
      delegate - 委譲する WebSocketSession 
      sendTimeLimit - 送信時間制限 (ミリ秒)
      bufferSizeLimit - バッファサイズの制限 (バイト数)
    • ConcurrentWebSocketSessionDecorator

      public ConcurrentWebSocketSessionDecorator(WebSocketSession delegate, int sendTimeLimit, int bufferSizeLimit, ConcurrentWebSocketSessionDecorator.OverflowStrategy overflowStrategy)
      使用するオーバーフロー戦略も指定するコンストラクター。
      パラメーター:
      delegate - 委譲する WebSocketSession 
      sendTimeLimit - 送信時間制限 (ミリ秒)
      bufferSizeLimit - バッファサイズの制限 (バイト数)
      overflowStrategy - 使用するオーバーフロー戦略。デフォルトではセッションは終了する
      導入:
      5.1
  • メソッドの詳細