Interface WebSocketServletFactory
public interface WebSocketServletFactory
Basic WebSocketServletFactory for working with Jetty-based WebSocketServlets
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptWebSocket(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) booleanacceptWebSocket(WebSocketCreator creator, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Get the set of available Extensions by registered name.Deprecated.this class is removed from Jetty 10.0.0+.Get the base policy in use for WebSockets.booleanisUpgradeRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) voidRegister a websocket class pojo with the defaultWebSocketCreator.voidsetCreator(WebSocketCreator creator) voidstart()voidstop()
-
Method Details
-
acceptWebSocket
boolean acceptWebSocket(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException - Throws:
IOException
-
acceptWebSocket
boolean acceptWebSocket(WebSocketCreator creator, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException - Throws:
IOException
-
start
- Throws:
Exception
-
stop
- Throws:
Exception
-
getAvailableExtensionNames
Get the set of available Extensions by registered name.- Returns:
- the set of available extensions by registered name.
-
getCreator
WebSocketCreator getCreator() -
getExtensionFactory
Deprecated.this class is removed from Jetty 10.0.0+. To remove specific extensions from negotiation useWebSocketCreatorto remove then during handshake.Get the registered extensions for this WebSocket factory.- Returns:
- the ExtensionFactory
- See Also:
-
getPolicy
WebSocketPolicy getPolicy()Get the base policy in use for WebSockets.Note: individual WebSocket implementations can override some of the values in here by using the
@WebSocketannotation.- Returns:
- the base policy
-
isUpgradeRequest
boolean isUpgradeRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) -
register
Register a websocket class pojo with the defaultWebSocketCreator.Note: only required if using the default
WebSocketCreatorprovided by this factory.- Parameters:
websocketPojo- the class to instantiate for each incoming websocket upgrade request.
-
setCreator
-