Annotation Interface WebSocketClient


@Retention(RUNTIME) @Target(TYPE) @Experimental("This API is experimental and may change in the future") public @interface WebSocketClient
Denotes a WebSocket client endpoint.

An endpoint must declare a method annotated with OnTextMessage, OnBinaryMessage, OnPongMessage or OnOpen. An endpoint may declare a method annotated with OnClose.

Lifecycle and concurrency

Client endpoint implementation class must be a CDI bean. If no scope annotation is defined then Singleton is used. ApplicationScoped and Singleton client endpoints are shared accross all WebSocket client connections. Therefore, implementations should be either stateless or thread-safe.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The path of the endpoint on the server.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    By default, the fully qualified name of the annotated class is used.
    The mode used to process incoming events for a specific connection.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Constant value for clientId() indicating that the fully qualified name of the annotated class should be used.
  • Field Details

    • FCQN_NAME

      static final String FCQN_NAME
      Constant value for clientId() indicating that the fully qualified name of the annotated class should be used.
      See Also:
  • Element Details

    • clientId

      String clientId
      By default, the fully qualified name of the annotated class is used.
      Returns:
      the endpoint id
      See Also:
      Default:
      "<<fcqn name>>"
    • inboundProcessingMode

      InboundProcessingMode inboundProcessingMode
      The mode used to process incoming events for a specific connection.
      Default:
      SERIAL