接口的使用
org.springframework.web.socket.server.HandshakeInterceptor
使用HandshakeInterceptor的程序包 程序包 说明 org.springframework.web.socket.config.annotation Support for annotation-based WebSocket setup in configuration classes.org.springframework.web.socket.server.support Server-side support classes including container-specific strategies for upgrading a request.org.springframework.web.socket.sockjs.transport Server-side support for SockJS transports includingTransportHandler
implementations for processing incoming requests, theirsession
counterparts for sending messages over the various transports, andDefaultSockJsService
.org.springframework.web.socket.config.annotation中HandshakeInterceptor的使用
返回HandshakeInterceptor的org.springframework.web.socket.config.annotation中的方法 修饰符和类型 方法 说明 protected HandshakeInterceptor[]
AbstractWebSocketHandlerRegistration. getInterceptors()
protected HandshakeInterceptor[]
WebMvcStompWebSocketEndpointRegistration. getInterceptors()
参数类型为HandshakeInterceptor的org.springframework.web.socket.config.annotation中的方法 修饰符和类型 方法 说明 WebSocketHandlerRegistration
AbstractWebSocketHandlerRegistration. addInterceptors(HandshakeInterceptor... interceptors)
StompWebSocketEndpointRegistration
StompWebSocketEndpointRegistration. addInterceptors(HandshakeInterceptor... interceptors)
Configure the HandshakeInterceptor's to use.StompWebSocketEndpointRegistration
WebMvcStompWebSocketEndpointRegistration. addInterceptors(HandshakeInterceptor... interceptors)
WebSocketHandlerRegistration
WebSocketHandlerRegistration. addInterceptors(HandshakeInterceptor... interceptors)
Configure interceptors for the handshake request.protected abstract void
AbstractWebSocketHandlerRegistration. addWebSocketHandlerMapping(M mappings, WebSocketHandler wsHandler, HandshakeHandler handshakeHandler, HandshakeInterceptor[] interceptors, String path)
protected void
ServletWebSocketHandlerRegistration. addWebSocketHandlerMapping(MultiValueMap<HttpRequestHandler,String> mappings, WebSocketHandler webSocketHandler, HandshakeHandler handshakeHandler, HandshakeInterceptor[] interceptors, String path)
SockJsServiceRegistration
SockJsServiceRegistration. setInterceptors(HandshakeInterceptor... interceptors)
org.springframework.web.socket.server.support中HandshakeInterceptor的使用
实现HandshakeInterceptor的org.springframework.web.socket.server.support中的类 修饰符和类型 类 说明 class
HttpSessionHandshakeInterceptor
An interceptor to copy information from the HTTP session to the "handshake attributes" map to made available viaWebSocketSession.getAttributes()
.class
OriginHandshakeInterceptor
An interceptor to check requestOrigin
header value against a collection of allowed origins.返回变量类型为HandshakeInterceptor的类型的org.springframework.web.socket.server.support中的方法 修饰符和类型 方法 说明 List<HandshakeInterceptor>
WebSocketHttpRequestHandler. getHandshakeInterceptors()
Return the configured WebSocket handshake request interceptors.类型变量类型为HandshakeInterceptor的org.springframework.web.socket.server.support中的方法参数 修饰符和类型 方法 说明 void
WebSocketHttpRequestHandler. setHandshakeInterceptors(List<HandshakeInterceptor> interceptors)
Configure one or more WebSocket handshake request interceptors.类型变量类型为HandshakeInterceptor的org.springframework.web.socket.server.support中的构造器参数 构造器 说明 HandshakeInterceptorChain(List<HandshakeInterceptor> interceptors, WebSocketHandler wsHandler)
org.springframework.web.socket.sockjs.transport中HandshakeInterceptor的使用
返回变量类型为HandshakeInterceptor的类型的org.springframework.web.socket.sockjs.transport中的方法 修饰符和类型 方法 说明 List<HandshakeInterceptor>
TransportHandlingSockJsService. getHandshakeInterceptors()
Return the configured WebSocket handshake request interceptors.类型变量类型为HandshakeInterceptor的org.springframework.web.socket.sockjs.transport中的方法参数 修饰符和类型 方法 说明 void
TransportHandlingSockJsService. setHandshakeInterceptors(List<HandshakeInterceptor> interceptors)
Configure one or more WebSocket handshake request interceptors.