public class WebSocketHandler
extends org.springframework.web.socket.handler.AbstractWebSocketHandler
implements org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.web.context.ServletContextAware
| Constructor and Description |
|---|
WebSocketHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterConnectionClosed(org.springframework.web.socket.WebSocketSession socket,
org.springframework.web.socket.CloseStatus status) |
void |
afterConnectionEstablished(org.springframework.web.socket.WebSocketSession socket) |
protected void |
handleBinaryMessage(org.springframework.web.socket.WebSocketSession socket,
org.springframework.web.socket.BinaryMessage message)
Processes a client request containing a BLOB payload sent via the web socket session.
|
protected void |
handleTextMessage(org.springframework.web.socket.WebSocketSession socket,
org.springframework.web.socket.TextMessage message)
Processes a client request sent via the web socket session.
|
Object |
postProcessAfterInitialization(Object bean,
String beanName)
Detects and registers request handlers.
|
Object |
postProcessBeforeInitialization(Object bean,
String beanName)
NOP
|
static void |
registerRequestHandler(IRequestHandler handler)
Register a request handler.
|
static void |
send(ClientInvocation invocation)
Sends a client invocation request to the client via the web socket session derived from the
current execution context.
|
static void |
send(Collection<ClientInvocation> invocations)
Sends multiple client invocation requests to the client via the web socket session derived
from the current execution context.
|
static void |
send(org.springframework.web.socket.WebSocketSession socket,
ClientInvocation invocation)
Sends a client invocation request to the client via the web socket session.
|
static void |
send(org.springframework.web.socket.WebSocketSession socket,
Iterable<ClientInvocation> invocations)
Sends multiple client invocation requests to the client via the web socket session.
|
static void |
sendError(org.springframework.web.socket.WebSocketSession socket,
Throwable exception)
Sends an exception to the client for display via the web socket session.
|
void |
setServletContext(javax.servlet.ServletContext servletContext) |
boolean |
supportsPartialMessages() |
public static void registerRequestHandler(IRequestHandler handler)
handler - The request handler.public static void send(ClientInvocation invocation)
invocation - The client invocation request.public static void send(org.springframework.web.socket.WebSocketSession socket,
ClientInvocation invocation)
socket - The web socket session. If null, the session is derived from the current
execution context.invocation - The client invocation request.public static void send(Collection<ClientInvocation> invocations)
invocations - The client invocation requests.public static void send(org.springframework.web.socket.WebSocketSession socket,
Iterable<ClientInvocation> invocations)
socket - The web socket session. If null, the session is derived from the current
execution context.invocations - The client invocation requests.public static void sendError(org.springframework.web.socket.WebSocketSession socket,
Throwable exception)
socket - The web socket session. If null, the session is derived from the current
execution context.exception - The exception.protected void handleTextMessage(org.springframework.web.socket.WebSocketSession socket,
org.springframework.web.socket.TextMessage message)
handleTextMessage in class org.springframework.web.socket.handler.AbstractWebSocketHandlersocket - The web socket session transmitting the request.message - The message containing the client request.protected void handleBinaryMessage(org.springframework.web.socket.WebSocketSession socket,
org.springframework.web.socket.BinaryMessage message)
throws Exception
handleBinaryMessage in class org.springframework.web.socket.handler.AbstractWebSocketHandlersocket - The web socket session transmitting the request.message - The message containing the client request.Exceptionpublic void afterConnectionEstablished(org.springframework.web.socket.WebSocketSession socket)
throws Exception
afterConnectionEstablished in interface org.springframework.web.socket.WebSocketHandlerafterConnectionEstablished in class org.springframework.web.socket.handler.AbstractWebSocketHandlerExceptionpublic void afterConnectionClosed(org.springframework.web.socket.WebSocketSession socket,
org.springframework.web.socket.CloseStatus status)
throws Exception
afterConnectionClosed in interface org.springframework.web.socket.WebSocketHandlerafterConnectionClosed in class org.springframework.web.socket.handler.AbstractWebSocketHandlerExceptionpublic boolean supportsPartialMessages()
supportsPartialMessages in interface org.springframework.web.socket.WebSocketHandlersupportsPartialMessages in class org.springframework.web.socket.handler.AbstractWebSocketHandlerpublic Object postProcessBeforeInitialization(Object bean, String beanName) throws org.springframework.beans.BeansException
postProcessBeforeInitialization in interface org.springframework.beans.factory.config.BeanPostProcessororg.springframework.beans.BeansExceptionpublic Object postProcessAfterInitialization(Object bean, String beanName) throws org.springframework.beans.BeansException
postProcessAfterInitialization in interface org.springframework.beans.factory.config.BeanPostProcessororg.springframework.beans.BeansExceptionpublic void setServletContext(javax.servlet.ServletContext servletContext)
setServletContext in interface org.springframework.web.context.ServletContextAwareCopyright © 2017 Regenstrief Center for Biomedical Informatics. All rights reserved.