Interface WebSocketServletFactory
-
public interface WebSocketServletFactoryBasic WebSocketServletFactory for working with Jetty-based WebSocketServlets
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classWebSocketServletFactory.Loader
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanacceptWebSocket(HttpServletRequest request, HttpServletResponse response)booleanacceptWebSocket(WebSocketCreator creator, HttpServletRequest request, HttpServletResponse response)WebSocketCreatorgetCreator()org.eclipse.jetty.websocket.api.extensions.ExtensionFactorygetExtensionFactory()org.eclipse.jetty.websocket.api.WebSocketPolicygetPolicy()Get the base policy in use for WebSockets.booleanisUpgradeRequest(HttpServletRequest request, HttpServletResponse response)voidregister(Class<?> websocketPojo)Register a websocket class pojo with the defaultWebSocketCreator.voidsetCreator(WebSocketCreator creator)voidstart()voidstop()
-
-
-
Method Detail
-
acceptWebSocket
boolean acceptWebSocket(HttpServletRequest request, HttpServletResponse response) throws IOException
- Throws:
IOException
-
acceptWebSocket
boolean acceptWebSocket(WebSocketCreator creator, HttpServletRequest request, HttpServletResponse response) throws IOException
- Throws:
IOException
-
getCreator
WebSocketCreator getCreator()
-
getExtensionFactory
org.eclipse.jetty.websocket.api.extensions.ExtensionFactory getExtensionFactory()
-
getPolicy
org.eclipse.jetty.websocket.api.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(HttpServletRequest request, HttpServletResponse response)
-
register
void register(Class<?> websocketPojo)
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
void setCreator(WebSocketCreator creator)
-
-