Annotation Interface Service


@Documented @Qualifier @Retention(RUNTIME) @Target({FIELD,METHOD,TYPE,TYPE_USE}) public @interface Service
Annotation used to specify that a bean should be published as a service.

The behavior of this annotation depends on it's usage:

  • on the bean type - publish the service using all implemented interfaces. If there are no implemented interfaces use the bean class.
  • on the bean's type_use(s) - publish the service using the collected interface(s).
Use of @Service on both type and type_use will result in a definition error.

Where this annotation is used affects how service scopes are supported:

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    Support inline instantiation of the Service annotation.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Class<?>[]
    Override the interfaces under which this service is published.
  • Element Details

    • value

      Class<?>[] value
      Override the interfaces under which this service is published.
      Returns:
      the service types
      Default:
      {}