public.javadoc.org.spincast.core.websocket.WebsocketRouteHandler.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spincast-website Show documentation
Show all versions of spincast-website Show documentation
Source code for the https://www.spincast.org website.
WebsocketRouteHandler (org.spincast:spincast-framework 1.0.0 API)
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
Fields
Modifier and Type
Field and Description
protected org.slf4j.Logger
logger
-
Constructor Summary
Constructors
Constructor and Description
WebsocketRouteHandler(WebsocketRoute<R,W> websocketRoute,
Server server,
WebsocketEndpointHandlerFactory<R,W> websocketServerEndpointHandlerFactory,
WebsocketEndpointToControllerManager websocketEndpointToControllerKeysMap)
-
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
protected 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
getServer()
protected Map<String,WebsocketEndpointHandler>
getServerEndpointHandlers()
protected WebsocketEndpointToControllerManager
getWebsocketEndpointToControllerManager()
protected WebsocketRoute<R,W>
getWebsocketRoute()
protected WebsocketEndpointHandlerFactory<R,W>
getWebsocketServerEndpointHandlerFactory()
void
handle(R context)
The handle() method for WebSocket handshaking,
called by the front controller once the potential
"before" filters have been ran.
protected void
manageCancellationFromOnPeerPreConnect()
Managed a null
returned by the onPeerPreConnect()
method of the controller.
-
-
Constructor Detail
-
WebsocketRouteHandler
public WebsocketRouteHandler(WebsocketRoute<R,W> websocketRoute,
Server server,
WebsocketEndpointHandlerFactory<R,W> websocketServerEndpointHandlerFactory,
WebsocketEndpointToControllerManager websocketEndpointToControllerKeysMap)
-
Method Detail
-
getWebsocketRoute
protected WebsocketRoute<R,W> getWebsocketRoute()
-
getServer
protected Server getServer()
-
getServerEndpointHandlers
protected Map<String,WebsocketEndpointHandler> getServerEndpointHandlers()
-
getWebsocketServerEndpointHandlerFactory
protected WebsocketEndpointHandlerFactory<R,W> getWebsocketServerEndpointHandlerFactory()
-
getWebsocketEndpointToControllerManager
protected WebsocketEndpointToControllerManager getWebsocketEndpointToControllerManager()
-
handle
public void handle(R context)
The handle() method for WebSocket handshaking,
called by the front controller once the potential
"before" filters have been ran.
- Specified by:
handle
in interface Handler<R extends RequestContext<?>>
-
manageCancellationFromOnPeerPreConnect
protected void manageCancellationFromOnPeerPreConnect()
Managed a null
returned by the onPeerPreConnect()
method of the controller.
-
createWebsocketEndpointHandler
protected WebsocketEndpointHandler createWebsocketEndpointHandler(String endpointId,
WebsocketController<R,W> controller)
Copyright © 2019. All rights reserved.