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

public Interface WebSocketCreator

Imports
org.eclipse.jetty.util.Callback

Abstract WebSocket creator interface.

This can be used for filtering of the WebSocket object creation due to criteria such as origin or sub-protocol, or for choosing a specific WebSocket object based on the upgrade request.

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

the WebSocket object, or null to take responsibility to send error response if no WebSocket is to be created.
createWebSocket
(ServerUpgradeRequest
the request details
request
,
ServerUpgradeResponse
the response details
response
,
Callback
the callback, should only be completed by the creator if a null WebSocket object is returned.
callback
)

Create a websocket from the incoming request.

Method Detail

createWebSocketback to summary
public Object createWebSocket(ServerUpgradeRequest request, ServerUpgradeResponse response, Callback callback)

Create a websocket from the incoming request.

If the creator returns null it is responsible for completing the Callback and sending a response. But if the creator intends to return non-null WebSocket object, it MUST NOT write content to the response or complete the Callback, but it may modify the response headers.

Parameters
request:ServerUpgradeRequest

the request details

response:ServerUpgradeResponse

the response details

callback:Callback

the callback, should only be completed by the creator if a null WebSocket object is returned.

Returns:Object

the WebSocket object, or null to take responsibility to send error response if no WebSocket is to be created.