Annotation Interface WebSocketClient.Endpoint

Enclosing class:
WebSocketClient

@Target(TYPE) @Retention(CLASS) @Documented @Inherited @Qualifier @Singleton public static @interface WebSocketClient.Endpoint
Definition of the websocket client API. A class can be annotated with this annotation and use WebSocket operations through annotations in WebSocket. The class should also have a Http.Path annotation to specify the path on the server.

In case key client node exists under the configuration node of this API, a new client will be created for this instance (this always wins). In case the clientName() is defined, and an instance of that name is available in registry, it will be used for this instance. Then we use an unnamed client instance from the registry (if any). The last resort is to create a new client that would be used for this API.

Important: for each endpoint a class is generated that is named as ClassNameFactory. If such a class already exists, there will be a name conflict, use factoryClassName() to specify a custom class name in such a case. The factory will always be in the same package as the annotated type.

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The base URI of this API.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Name of a named instance of WsClient we attempt to get from registry.
    Configuration key base to use when looking up options for the generated client.
    Class name of the generated factory, default to ClassNameOfAnnotatedTypeFactory, i.e.
  • Element Details

    • value

      String value
      The base URI of this API.

      Note that Http.Path annotation on the API is added to this value.

      Note that if the provided client (either from service registry, or provided to the factory) has a base URI specified, this value will be ignored, and only the configured path will be used.

      Returns:
      endpoint URI of the generated client
    • configKey

      String configKey
      Configuration key base to use when looking up options for the generated client.
      Returns:
      configuration key prefix
      Default:
      ""
    • clientName

      String clientName
      Name of a named instance of WsClient we attempt to get from registry.
      Returns:
      client name
      Default:
      ""
    • factoryClassName

      String factoryClassName
      Class name of the generated factory, default to ClassNameOfAnnotatedTypeFactory, i.e. for a type named EchoClientEndpoint, we would generate an `EchoClientEndpointFactory.
      Returns:
      custom class name for the generated endpoint factory
      Default:
      ""