Annotation Type RSResourceScope


@Retention(RUNTIME) @Target(TYPE) public @interface RSResourceScope
Use this annotation to decorate JAX-RS resources (eg. classes annotated with @jakarta.ws.rs.Path) in order to specify whether the resource should be treated as a singleton or if you want your class be instantiated upon every request. By default, if this annotation is not used, it is assumed the resource is a singleton.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Whether the resource class will be instantiated only one time or once every request.
  • Element Details

    • singleton

      boolean singleton
      Whether the resource class will be instantiated only one time or once every request.
      Returns:
      Boolean value
      Default:
      true