Interface WebSocketServletFactory
-
- All Known Implementing Classes:
WebSocketServerFactory
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(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)booleanacceptWebSocket(WebSocketCreator creator, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)WebSocketCreatorgetCreator()ExtensionFactorygetExtensionFactory()WebSocketPolicygetPolicy()Get the base policy in use for WebSockets.booleanisUpgradeRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)voidregister(java.lang.Class<?> websocketPojo)Register a websocket class pojo with the defaultWebSocketCreator.voidsetCreator(WebSocketCreator creator)voidstart()voidstop()
-
-
-
Method Detail
-
acceptWebSocket
boolean acceptWebSocket(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException- Throws:
java.io.IOException
-
acceptWebSocket
boolean acceptWebSocket(WebSocketCreator creator, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException
- Throws:
java.io.IOException
-
start
void start() throws java.lang.Exception- Throws:
java.lang.Exception
-
stop
void stop() throws java.lang.Exception
- Throws:
java.lang.Exception
-
getCreator
WebSocketCreator getCreator()
-
getExtensionFactory
ExtensionFactory getExtensionFactory()
-
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
void register(java.lang.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)
-
-