Package org.spincast.core.websocket
Class WebsocketRouteHandler<R extends RequestContext<?>,W extends WebsocketContext<?>>
java.lang.Object
org.spincast.core.websocket.WebsocketRouteHandler<R,W>
- All Implemented Interfaces:
Handler<R>
public class WebsocketRouteHandler<R extends RequestContext<?>,W extends WebsocketContext<?>>
extends Object
implements Handler<R>
Route handler that manages the upgrade from
a HTTP request to a WebSocket connection, once the
potential "before" filters have been ran.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionWebsocketRouteHandler
(WebsocketRoute<R, W> websocketRoute, Server server, WebsocketEndpointHandlerFactory<R, W> websocketServerEndpointHandlerFactory, WebsocketEndpointToControllerManager websocketEndpointToControllerKeysMap) -
Method Summary
Modifier and TypeMethodDescriptionprotected WebsocketEndpointHandler
createWebsocketEndpointHandler
(String endpointId, WebsocketController<R, W> controller) protected String
generatePeerId
(R context, String endpointId) Generate a peer id when none is specified by the controller.protected Object
getEndpointCreationLock
(String endpointId) protected Server
protected Map<String,
WebsocketEndpointHandler> protected WebsocketEndpointToControllerManager
protected WebsocketRoute<R,
W> protected WebsocketEndpointHandlerFactory<R,
W> void
The handle() method for WebSocket handshaking, called by the front controller once the potential "before" filters have been ran.protected void
Managed anull
returned by the onPeerPreConnect() method of the controller.
-
Field Details
-
logger
protected static final org.slf4j.Logger logger
-
-
Constructor Details
-
WebsocketRouteHandler
public WebsocketRouteHandler(WebsocketRoute<R, W> websocketRoute, Server server, WebsocketEndpointHandlerFactory<R, W> websocketServerEndpointHandlerFactory, WebsocketEndpointToControllerManager websocketEndpointToControllerKeysMap)
-
-
Method Details
-
getWebsocketRoute
-
getServer
-
getServerEndpointHandlers
-
getWebsocketServerEndpointHandlerFactory
-
getWebsocketEndpointToControllerManager
-
getEndpointCreationLock
-
handle
The handle() method for WebSocket handshaking, called by the front controller once the potential "before" filters have been ran.- Specified by:
handle
in interfaceHandler<R extends RequestContext<?>>
-
manageCancellationFromOnPeerPreConnect
protected void manageCancellationFromOnPeerPreConnect()Managed anull
returned by the onPeerPreConnect() method of the controller. -
createWebsocketEndpointHandler
protected WebsocketEndpointHandler createWebsocketEndpointHandler(String endpointId, WebsocketController<R, W> controller) -
generatePeerId
Generate a peer id when none is specified by the controller.
-