クラス ServerWebSocketContainer
java.lang.ObjectSE
org.springframework.integration.websocket.IntegrationWebSocketContainer
org.springframework.integration.websocket.ServerWebSocketContainer
- 実装済みのインターフェース一覧:
DisposableBean、Lifecycle、Phased、SmartLifecycle、WebSocketConfigurer
public class ServerWebSocketContainer
extends IntegrationWebSocketContainer
implements WebSocketConfigurer, SmartLifecycle
server WebSocketHandler 登録用の IntegrationWebSocketContainer 実装。 提供された paths の内部 IntegrationWebSocketContainer.IntegrationWebSocketHandler を WebSocketHandlerRegistry に登録します。
実際の登録は、このクラスの WebSocketConfigurer 実装を介した Spring Web-Socket インフラストラクチャに基づいています。
- 導入:
- 4.1
- 作成者:
- Artem Bilan, Gary Russell, Christian Tzolov
ネストされたクラスの概要
ネストされたクラスフィールド概要
クラス org.springframework.integration.websocket.IntegrationWebSocketContainer から継承されたフィールド
DEFAULT_SEND_BUFFER_SIZE, DEFAULT_SEND_TIME_LIMIT, lock, logger, sessionsインターフェース org.springframework.context.SmartLifecycle から継承されたフィールド
DEFAULT_PHASEコンストラクター概要
コンストラクター方法の概要
修飾子と型メソッド説明intgetPhase()booleanbooleanvoidsetAllowedOrigins(StringSE... origins) 許可されたOriginヘッダー値を構成します。voidsetAutoStartup(boolean autoStartup) setDecoratorFactories(WebSocketHandlerDecoratorFactory... factories) WebSocket メッセージの処理に使用されるハンドラーを装飾するように 1 つ以上のファクトリを構成します。setHandshakeHandler(HandshakeHandler handshakeHandler) setInterceptors(HandshakeInterceptor... interceptors) voidsetPhase(int phase) voidsetSockJsServiceOptions(ServerWebSocketContainer.SockJsServiceOptions sockJsServiceOptions) voidsetSockJsTaskScheduler(TaskScheduler sockJsTaskScheduler) SockJS フォールバックサービス用にTaskSchedulerを構成します。voidstart()voidstop()voidstop(RunnableSE callback) withSockJs(ServerWebSocketContainer.SockJsServiceOptions... sockJsServiceOptions) クラス org.springframework.integration.websocket.IntegrationWebSocketContainer から継承されたメソッド
addSupportedProtocols, closeSession, destroy, getSession, getSessions, getSubProtocols, getWebSocketHandler, setMessageListener, setSendBufferOverflowStrategy, setSendBufferSizeLimit, setSendTimeLimit, setSupportedProtocols, setWebSocketHandler
コンストラクターの詳細
ServerWebSocketContainer
方法の詳細
setHandshakeHandler
setInterceptors
setDecoratorFactories
public ServerWebSocketContainer setDecoratorFactories(WebSocketHandlerDecoratorFactory... factories) WebSocket メッセージの処理に使用されるハンドラーを装飾するように 1 つ以上のファクトリを構成します。これは、たとえば、対応する HTTP セッションの有効期限が切れたときに Spring Security が WebSocket セッションを強制的に閉じることを許可するなど、一部の高度な使用例で役立つ場合があります。- パラメーター:
factories- 使用する WebSocketHandlerDecoratorFactory 配列- 戻り値:
- 現在の ServerWebSocketContainer
- 導入:
- 4.2
setAllowedOrigins
許可されたOriginヘッダー値を構成します。- パラメーター:
origins- 許可する起源。- 戻り値:
- 現在の ServerWebSocketContainer
- 導入:
- 4.3
- 関連事項:
withSockJs
public ServerWebSocketContainer withSockJs(ServerWebSocketContainer.SockJsServiceOptions... sockJsServiceOptions) setSockJsServiceOptions
public void setSockJsServiceOptions(ServerWebSocketContainer.SockJsServiceOptions sockJsServiceOptions) setSockJsTaskScheduler
SockJS フォールバックサービス用にTaskSchedulerを構成します。これは、実行時に Websocket エンドポイント(このサーバーコンテナー)が登録されている場合のデフォルトの SockJS サービススケジューラの代替手段です。- パラメーター:
sockJsTaskScheduler- SockJS フォールバックサービス用のTaskScheduler。- 導入:
- 5.5.1
getSockJsTaskScheduler
registerWebSocketHandlers
- 次で指定:
- インターフェース
WebSocketConfigurer内のregisterWebSocketHandlers
setAutoStartup
public void setAutoStartup(boolean autoStartup) setPhase
public void setPhase(int phase) isAutoStartup
public boolean isAutoStartup()- 次で指定:
- インターフェース
SmartLifecycle内のisAutoStartup
getPhase
public int getPhase()- 次で指定:
- インターフェース
Phased内のgetPhase - 次で指定:
- インターフェース
SmartLifecycle内のgetPhase
isRunning
public boolean isRunning()start
public void start()stop
public void stop()stop
- 次で指定:
- インターフェース
SmartLifecycle内のstop