类 XhrStreamingTransportHandler
- java.lang.Object
- org.springframework.web.socket.sockjs.transport.handler.AbstractTransportHandler
- org.springframework.web.socket.sockjs.transport.handler.AbstractHttpSendingTransportHandler
- org.springframework.web.socket.sockjs.transport.handler.XhrStreamingTransportHandler
- 所有已实现的接口:
SockJsSessionFactory
,TransportHandler
public class XhrStreamingTransportHandler extends AbstractHttpSendingTransportHandler
ATransportHandler
that sends messages over an HTTP streaming request.- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev
字段概要
从类继承的字段 org.springframework.web.socket.sockjs.transport.handler.AbstractTransportHandler
logger, UTF8_CHARSET
构造器概要
构造器 构造器 说明 XhrStreamingTransportHandler()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 boolean
checkSessionType(SockJsSession session)
Check whether the type of the given session matches the transport type of thisTransportHandler
where session id and the transport type are extracted from the SockJS URL.StreamingSockJsSession
createSession(String sessionId, WebSocketHandler handler, Map<String,Object> attributes)
Create a new SockJS session.protected MediaType
getContentType()
protected SockJsFrameFormat
getFrameFormat(ServerHttpRequest request)
TransportType
getTransportType()
Return the transport type supported by this handler.从类继承的方法 org.springframework.web.socket.sockjs.transport.handler.AbstractHttpSendingTransportHandler
getCallbackParam, handleRequest, handleRequestInternal
从类继承的方法 org.springframework.web.socket.sockjs.transport.handler.AbstractTransportHandler
getServiceConfig, initialize
构造器详细资料
XhrStreamingTransportHandler
public XhrStreamingTransportHandler()
方法详细资料
getTransportType
public TransportType getTransportType()
从接口复制的说明:TransportHandler
Return the transport type supported by this handler.
getContentType
protected MediaType getContentType()
checkSessionType
public boolean checkSessionType(SockJsSession session)
从接口复制的说明:TransportHandler
Check whether the type of the given session matches the transport type of thisTransportHandler
where session id and the transport type are extracted from the SockJS URL.- 返回:
true
if the session matches (and would therefore get accepted byTransportHandler.handleRequest(org.springframework.http.server.ServerHttpRequest, org.springframework.http.server.ServerHttpResponse, org.springframework.web.socket.WebSocketHandler, org.springframework.web.socket.sockjs.transport.SockJsSession)
), orfalse
otherwise
createSession
public StreamingSockJsSession createSession(String sessionId, WebSocketHandler handler, Map<String,Object> attributes)
从接口复制的说明:SockJsSessionFactory
Create a new SockJS session.- 参数:
sessionId
- the ID of the sessionhandler
- the underlyingWebSocketHandler
attributes
- handshake request specific attributes- 返回:
- a new session, never
null
getFrameFormat
protected SockJsFrameFormat getFrameFormat(ServerHttpRequest request)