T - ネイティブセッション型 public abstract class AbstractWebSocketSession<T> extends java.lang.Object implements NativeWebSocketSession
WebSocketSession の実装の抽象基本クラス。| 修飾子と型 | フィールドと説明 |
|---|---|
protected static IdGenerator | idGenerator |
protected static Log | logger |
| コンストラクターと説明 |
|---|
AbstractWebSocketSession(java.util.Map<java.lang.String,java.lang.Object> attributes) 新しいインスタンスを作成し、指定された属性をそれに関連付けます。 |
| 修飾子と型 | メソッドと説明 |
|---|---|
protected void | checkNativeSessionInitialized() |
void | close() ステータス 1000 で WebSocket 接続を閉じます。 |
void | close(CloseStatus status) 指定されたクローズ状態で WebSocket 接続を閉じます。 |
protected abstract void | closeInternal(CloseStatus status) |
java.util.Map<java.lang.String,java.lang.Object> | getAttributes()WebSocket セッションに関連付けられた属性を持つマップを返します。 |
T | getNativeSession() 基礎となるネイティブ WebSocketSession を返します。 |
<R> R | getNativeSession(java.lang.Class<R> requiredType) 使用可能な場合、基礎となるネイティブ WebSocketSession を返します。 |
void | initializeNativeSession(T session) |
protected abstract void | sendBinaryMessage(BinaryMessage message) |
void | sendMessage(WebSocketMessage<?> message)WebSocket メッセージを送信する: TextMessage または BinaryMessage のいずれか。 |
protected abstract void | sendPingMessage(PingMessage message) |
protected abstract void | sendPongMessage(PongMessage message) |
protected abstract void | sendTextMessage(TextMessage message) |
java.lang.String | toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetAcceptedProtocol, getBinaryMessageSizeLimit, getExtensions, getHandshakeHeaders, getId, getLocalAddress, getPrincipal, getRemoteAddress, getTextMessageSizeLimit, getUri, isOpen, setBinaryMessageSizeLimit, setTextMessageSizeLimitprotected static final IdGenerator idGenerator
protected static final Log logger
public AbstractWebSocketSession(@Nullable java.util.Map<java.lang.String,java.lang.Object> attributes)
attributes - WebSocket セッションに関連付ける HTTP ハンドシェイクの属性。指定された属性はコピーされ、元のマップは使用されません。public java.util.Map<java.lang.String,java.lang.Object> getAttributes()
WebSocketSession サーバー側では、最初に HandshakeInterceptor を介してマップにデータを入力できます。クライアント側では、WebSocketClient ハンドシェイクメソッドを介してマップにデータを入力できます。
WebSocketSession 内の getAttributes null ではない)public T getNativeSession()
NativeWebSocketSessionNativeWebSocketSession 内の getNativeSession @Nullable public <R> R getNativeSession(@Nullable java.lang.Class<R> requiredType)
NativeWebSocketSessionNativeWebSocketSession 内の getNativeSession requiredType - 必要なセッションの型 null public void initializeNativeSession(T session)
protected final void checkNativeSessionInitialized()
public final void sendMessage(WebSocketMessage<?> message) throws java.io.IOException
WebSocketSessionTextMessage または BinaryMessage のいずれか。WebSocketSession 内の sendMessage java.io.IOExceptionprotected abstract void sendTextMessage(TextMessage message) throws java.io.IOException
java.io.IOExceptionprotected abstract void sendBinaryMessage(BinaryMessage message) throws java.io.IOException
java.io.IOExceptionprotected abstract void sendPingMessage(PingMessage message) throws java.io.IOException
java.io.IOExceptionprotected abstract void sendPongMessage(PongMessage message) throws java.io.IOException
java.io.IOExceptionpublic final void close()
throws java.io.IOExceptionWebSocketSessionsession.close(CloseStatus.NORMAL);
java.io.Closeable 内の close java.lang.AutoCloseable 内の close WebSocketSession 内の close java.io.IOExceptionpublic final void close(CloseStatus status) throws java.io.IOException
WebSocketSessionWebSocketSession 内の close java.io.IOExceptionprotected abstract void closeInternal(CloseStatus status) throws java.io.IOException
java.io.IOExceptionpublic java.lang.String toString()
java.lang.Object の toString