类 AbstractWebSocketClient
- java.lang.Object
- org.springframework.web.socket.client.AbstractWebSocketClient
- 所有已实现的接口:
WebSocketClient
public abstract class AbstractWebSocketClient extends Object implements WebSocketClient
Abstract base class forWebSocketClientimplementations.- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev
构造器概要
构造器 构造器 说明 AbstractWebSocketClient()
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 protected voidassertUri(URI uri)ListenableFuture<WebSocketSession>doHandshake(WebSocketHandler webSocketHandler, String uriTemplate, Object... uriVars)ListenableFuture<WebSocketSession>doHandshake(WebSocketHandler webSocketHandler, WebSocketHttpHeaders headers, URI uri)protected abstract ListenableFuture<WebSocketSession>doHandshakeInternal(WebSocketHandler webSocketHandler, HttpHeaders headers, URI uri, List<String> subProtocols, List<WebSocketExtension> extensions, Map<String,Object> attributes)Perform the actual handshake to establish a connection to the server.
构造器详细资料
AbstractWebSocketClient
public AbstractWebSocketClient()
方法详细资料
doHandshake
public ListenableFuture<WebSocketSession> doHandshake(WebSocketHandler webSocketHandler, String uriTemplate, Object... uriVars)
- 指定者:
doHandshake在接口中WebSocketClient
doHandshake
public final ListenableFuture<WebSocketSession> doHandshake(WebSocketHandler webSocketHandler, WebSocketHttpHeaders headers, URI uri)
- 指定者:
doHandshake在接口中WebSocketClient
doHandshakeInternal
protected abstract ListenableFuture<WebSocketSession> doHandshakeInternal(WebSocketHandler webSocketHandler, HttpHeaders headers, URI uri, List<String> subProtocols, List<WebSocketExtension> extensions, Map<String,Object> attributes)
Perform the actual handshake to establish a connection to the server.- 参数:
webSocketHandler- the client-side handler for WebSocket messagesheaders- HTTP headers to use for the handshake, with unwanted (forbidden) headers filtered out, nevernulluri- the target URI for the handshake, nevernullsubProtocols- requested sub-protocols, or an empty listextensions- requested WebSocket extensions, or an empty listattributes- attributes to associate with the WebSocketSession, i.e. viaWebSocketSession.getAttributes(); currently always an empty map.- 返回:
- the established WebSocket session wrapped in a ListenableFuture.