Class BusWebSockets
The endpoint is context-relative ("/juneau-bus/ws/{sessionId}") because WebSocket endpoints are not servlet-mapped. Origin is
the CSRF control for the handshake, so registration refuses a policy with no Origin rule. The rule is
LoopbackBoundary.origin() for a LoopbackBoundary, the handshake's own scheme and Host for a
CsrfBoundary, and BusPolicy.allowedOrigins when the policy has no boundary. Any other boundary
type is refused: the handshake cannot apply a boundary it does not know.
Example:
- Since:
- 10.0.0
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidRegisters the endpoint on the container found in the servlet context.static voidRegisters the endpoint on a container.
-
Field Details
-
PATH
The context-relative endpoint path.- See Also:
-
PREFIX
PATHwithout its path parameter; passed toServerBus.enableWebSocket(String).- See Also:
-
-
Method Details
-
register
Registers the endpoint on the container found in the servlet context.- Parameters:
ctx- The servlet context.bus- The bus whose sessions the endpoint serves.- Throws:
IllegalStateException- noServerContainerattribute, no Origin rule, or a boundary type the handshake cannot apply.
-
register
Registers the endpoint on a container.Enables the bus's WebSocket transport only after the container accepted the endpoint, so a session POST never advertises a path that is not served.
- Parameters:
container- The container.bus- The bus whose sessions the endpoint serves.- Throws:
IllegalStateException- no Origin rule, a boundary type the handshake cannot apply, or the container refused the endpoint.
-