Annotation Interface Service.Singleton

Enclosing class:
Service

@Documented @Retention(CLASS) @Scope @Target({TYPE,ANNOTATION_TYPE}) public static @interface Service.Singleton
A singleton service. The service registry will only contain a single instance of this service, and all injection points will be satisfied by the same instance.

A singleton instance is guaranteed to have its constructor, post-construct, and pre-destroy methods invoked once within the lifecycle of the service registry.

Alternative to this annotation is Service.PerLookup, or a custom Service.Scope annotation.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final TypeName
    Type name of this annotation.
  • Field Details

    • TYPE

      static final TypeName TYPE
      Type name of this annotation.