java.lang.Object
jakarta.websocket.Endpoint
org.omnifaces.cdi.push.SocketEndpoint
This web socket server endpoint handles web socket requests coming from <o:socket>.
- Since:
- 2.3
- Author:
- Bauke Scholtz
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe context-relative URI template where the web socket endpoint should listen on. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidonClose(Session session, CloseReason reason) Remove given web socket session from theSocketSessionManager.voidDelegate exception to onClose.voidonOpen(Session session, EndpointConfig config) Add given web socket session to theSocketSessionManager.
-
Field Details
-
URI_TEMPLATE
The context-relative URI template where the web socket endpoint should listen on.- See Also:
-
-
Constructor Details
-
SocketEndpoint
public SocketEndpoint()
-
-
Method Details
-
onOpen
Add given web socket session to theSocketSessionManager. If web socket session is not accepted (i.e. the channel identifier is unknown), then immediately close with reason VIOLATED_POLICY (close code 1008). -
onError
Delegate exception to onClose. -
onClose
Remove given web socket session from theSocketSessionManager. If there is any exception from onError which was not caused byCloseReason.CloseCodes.GOING_AWAY(i.e. "connection reset by peer"), then log it asLevel.SEVERE, else asLevel.FINE. Before OmniFaces 4.6, theCloseReason.CloseCodes.GOING_AWAYwas not logged at all.
-