类 AbstractHttpReceivingTransportHandler
- java.lang.Object
- org.springframework.web.socket.sockjs.transport.handler.AbstractTransportHandler
- org.springframework.web.socket.sockjs.transport.handler.AbstractHttpReceivingTransportHandler
- 所有已实现的接口:
TransportHandler
- 直接已知子类:
XhrReceivingTransportHandler
public abstract class AbstractHttpReceivingTransportHandler extends AbstractTransportHandler
Base class for HTTP transport handlers that receive messages via HTTP POST.- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev
字段概要
从类继承的字段 org.springframework.web.socket.sockjs.transport.handler.AbstractTransportHandler
logger
构造器概要
构造器 构造器 说明 AbstractHttpReceivingTransportHandler()
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 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.protected abstract HttpStatus
getResponseStatus()
void
handleRequest(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, SockJsSession wsSession)
Handle the given request and delegate messages to the providedWebSocketHandler
.protected void
handleRequestInternal(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, AbstractHttpSockJsSession sockJsSession)
protected abstract String[]
readMessages(ServerHttpRequest request)
从类继承的方法 org.springframework.web.socket.sockjs.transport.handler.AbstractTransportHandler
getServiceConfig, initialize
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 org.springframework.web.socket.sockjs.transport.TransportHandler
getTransportType
构造器详细资料
AbstractHttpReceivingTransportHandler
public AbstractHttpReceivingTransportHandler()
方法详细资料
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
handleRequest
public final void handleRequest(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, SockJsSession wsSession) throws SockJsException
从接口复制的说明:TransportHandler
Handle the given request and delegate messages to the providedWebSocketHandler
.- 参数:
request
- the current requestresponse
- the current responsewsHandler
- the target WebSocketHandler (nevernull
)wsSession
- the SockJS session (nevernull
)- 抛出:
SockJsException
- raised when request processing fails as explained inSockJsService
handleRequestInternal
protected void handleRequestInternal(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, AbstractHttpSockJsSession sockJsSession) throws SockJsException
readMessages
@Nullable protected abstract String[] readMessages(ServerHttpRequest request) throws IOException
- 抛出:
IOException
getResponseStatus
protected abstract HttpStatus getResponseStatus()