Endpoint (WebSocket 2.1 API Documentation - Apache Tomcat 10.1.54)
Description: declaration: package: jakarta.websocket, class: Endpoint

# Class Endpoint

java.lang.Object
jakarta.websocket.Endpoint

public abstract class Endpoint extends Object

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Endpoint()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `onClose(Session session, CloseReason closeReason)`
  Event that is triggered when a session has closed.
  `void`
  `onError(Session session, Throwable throwable)`
  Event that is triggered when a protocol error occurs.
  `abstract void`
  `onOpen(Session session, EndpointConfig config)`
  Event that is triggered when a new session starts.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Endpoint

    public Endpoint()

- ## Method Details

  - ### onOpen

    public abstract void onOpen(Session session, EndpointConfig config)
    Event that is triggered when a new session starts.
    Parameters:
      `session` - The new session.
      `config` - The configuration with which the Endpoint was configured.

  - ### onClose

    public void onClose(Session session, CloseReason closeReason)
    Event that is triggered when a session has closed.
    Parameters:
      `session` - The session
      `closeReason` - Why the session was closed

  - ### onError

    public void onError(Session session, Throwable throwable)
    Event that is triggered when a protocol error occurs.
    Parameters:
      `session` - The session.
      `throwable` - The exception.