Package org.glassfish.grizzly.websockets
Class WebSocketEngine
java.lang.Object
org.glassfish.grizzly.websockets.WebSocketEngine
WebSockets engine implementation (singleton), which handles
WebSocketApplications registration, responsible
for client and server handshake validation.- Author:
- Alexey Stashok
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiongetApplication(HttpRequestPacket request) static WebSocketEnginestatic ProtocolHandlerloadHandler(MimeHeaders headers) voidregister(String contextPath, String urlPattern, WebSocketApplication app) Register a WebSocketApplication to a specific context path and url pattern.voidDeprecated.voidvoidUn-registers allWebSocketApplicationinstances with theWebSocketEngine.booleanupgrade(FilterChainContext ctx, HttpContent requestContent) booleanupgrade(FilterChainContext ctx, HttpContent requestContent, Mapper mapper)
-
Field Details
-
DEFAULT_VERSION
-
DEFAULT_TIMEOUT
public static final int DEFAULT_TIMEOUT- See Also:
-
-
Method Details
-
getEngine
-
getApplication
-
upgrade
- Throws:
IOException
-
upgrade
public boolean upgrade(FilterChainContext ctx, HttpContent requestContent, Mapper mapper) throws IOException - Throws:
IOException
-
loadHandler
-
register
Register a WebSocketApplication to a specific context path and url pattern. If you wish to associate this application with the root context, use an empty string for the contextPath argument.Examples: // WS application will be invoked: // ws://localhost:8080/echo // WS application will not be invoked: // ws://localhost:8080/foo/echo // ws://localhost:8080/echo/some/path register("", "/echo", webSocketApplication); // WS application will be invoked: // ws://localhost:8080/echo // ws://localhost:8080/echo/some/path // WS application will not be invoked: // ws://localhost:8080/foo/echo register("", "/echo/*", webSocketApplication); // WS application will be invoked: // ws://localhost:8080/context/echo // WS application will not be invoked: // ws://localhost:8080/echo // ws://localhost:8080/context/some/path register("/context", "/echo", webSocketApplication);- Parameters:
contextPath- the context path (per servlet rules)urlPattern- url pattern (per servlet rules)app- the WebSocket application.
-
register
Deprecated. -
unregister
-
unregisterAll
public void unregisterAll()Un-registers allWebSocketApplicationinstances with theWebSocketEngine.
-
register(String, String, WebSocketApplication)