14.1.1 The Endpoint Annotation

An Endpoint can be created by annotating a class with the Endpoint annotation, and supplying it with (at minimum) an endpoint id.

FooEndpoint.java

  1. @Endpoint("foo")
  2. class FooEndpoint {
  3. ...
  4. }

If a single String argument is supplied to the annotation, it will be used as the endpoint id.

It is possible to supply additional (named) arguments to the annotation. Other possible arguments to @Endpoint are described in the table below:

Table 1. Endpoint Arguments
ArgumentDescriptionEndpoint Example

String id

The endpoint id (or name)

@Endpoint(id = “foo”)

String prefix

Prefix used for configuring the endpoint (see Endpoint Configuration)

@Endpoint(prefix = “foo”)

boolean defaultEnabled

Sets whether the endpoint is enabled when no configuration is set (see Endpoint Configuration)

@Endpoint(defaultEnabled = false)

boolean defaultSensitive

Sets whether the endpoint is sensitive if no configuration is set (see Endpoint Configuration)

@Endpoint(defaultSensitive = false)