Skip to content

More flexible approach to activate Beans by conditions #869

@hantsy

Description

@hantsy

Currently, there is a @Alternative annotation, but it also needs to be declared in XML configuration to activate a Bean at runtime.

Is it possible to design a @Conditional annotation and Condition interface like Spring to activate a CDI bean in source codes without XML declarations?

@ConditionalOnProperties
@ConditionalOnBean/ConditionalOnMissingBean
@ConditionalOnClass/CondtionalOnMissingClass
@ConditionalOnModule/CondtioinalOnMissingModule(java module)
...

https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/context/annotation/Conditional.html

https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/context/annotation/Condition.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions