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(org.glassfish.grizzly.http.HttpRequestPacket request) static WebSocketEnginestatic ProtocolHandlerloadHandler(org.glassfish.grizzly.http.util.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(org.glassfish.grizzly.filterchain.FilterChainContext ctx, org.glassfish.grizzly.http.HttpContent requestContent) booleanupgrade(org.glassfish.grizzly.filterchain.FilterChainContext ctx, org.glassfish.grizzly.http.HttpContent requestContent, org.glassfish.grizzly.http.server.util.Mapper mapper)
-
Field Details
-
DEFAULT_VERSION
-
DEFAULT_TIMEOUT
public static final int DEFAULT_TIMEOUT- See Also:
-
-
Method Details
-
getEngine
-
getApplication
-
upgrade
public boolean upgrade(org.glassfish.grizzly.filterchain.FilterChainContext ctx, org.glassfish.grizzly.http.HttpContent requestContent) throws IOException - Throws:
IOException
-
upgrade
public boolean upgrade(org.glassfish.grizzly.filterchain.FilterChainContext ctx, org.glassfish.grizzly.http.HttpContent requestContent, org.glassfish.grizzly.http.server.util.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)