Annotation Type Component


  • @Target(TYPE)
    @Retention(RUNTIME)
    public @interface Component
    Identify a bean as component with singleton scope that avaje-inject will use.

    This is an alternative to using the standard @Singleton annotation. We generally use @Component when we:

    • Want to use avaje-inject in a project that has some other library using @Singleton
    • Want to support BOTH javax.inject and jakarta.inject

    Example

    {@code
    See Also:
    InjectModule.ignoreSingleton()