Top Description Methods
org.eclipse.jetty.websocket.server

public Interface WebSocketCreator

Imports
org.eclipse.jetty.util.Callback

Allows to create (custom) WebSocket endpoints instances given the HTTP request and HTTP response.

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

a WebSocket endpoint instance, or null if no WebSocket endpoint instance should be created for the given upgrade request
createWebSocket
(ServerUpgradeRequest
the upgrade request
upgradeRequest
,
ServerUpgradeResponse
the upgrade response
upgradeResponse
,
Callback
the callback to complete only when returning null
callback
)

Creates a WebSocket endpoint instance from the incoming request.

Method Detail

createWebSocketback to summary
public Object createWebSocket(ServerUpgradeRequest upgradeRequest, ServerUpgradeResponse upgradeResponse, Callback callback) throws Exception

Creates a WebSocket endpoint instance from the incoming request.

If the implementation does not want to create a WebSocket endpoint instance, it is responsible to send a response (and completing the callback) and then it may return null.

If the implementation returns a non-null WebSocket endpoint instance, it must not write response content, nor completing the callback, but it may modify the response headers.

Parameters
upgradeRequest:ServerUpgradeRequest

the upgrade request

upgradeResponse:ServerUpgradeResponse

the upgrade response

callback:Callback

the callback to complete only when returning null

Returns:Object

a WebSocket endpoint instance, or null if no WebSocket endpoint instance should be created for the given upgrade request

Exceptions
Exception:
if the WebSocket endpoint instance creation fails