Class Endpoint
java.lang.Object
jakarta.websocket.Endpoint
Base class for programmatic WebSocket endpoints. Subclasses must implement the
onOpen(Session, EndpointConfig) method to handle new connections.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidonClose(Session session, CloseReason closeReason) Event that is triggered when a session has closed.voidEvent that is triggered when a protocol error occurs.abstract voidonOpen(Session session, EndpointConfig config) Event that is triggered when a new session starts.
-
Constructor Details
-
Endpoint
public Endpoint()Creates a new Endpoint instance.
-
-
Method Details
-
onOpen
Event that is triggered when a new session starts.- Parameters:
session- The new session.config- The configuration with which the Endpoint was configured.
-
onClose
Event that is triggered when a session has closed.- Parameters:
session- The sessioncloseReason- Why the session was closed
-
onError
-