diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/configurator/BeanConfigurator.java b/api/src/main/java/jakarta/enterprise/inject/spi/configurator/BeanConfigurator.java index d2594db0b..de5992298 100644 --- a/api/src/main/java/jakarta/enterprise/inject/spi/configurator/BeanConfigurator.java +++ b/api/src/main/java/jakarta/enterprise/inject/spi/configurator/BeanConfigurator.java @@ -316,4 +316,20 @@ public interface BeanConfigurator { */ BeanConfigurator alternative(boolean value); + /** + * Set the priority of the configured bean. + * By default, the configured bean does not have a priority. + *

+ * This is equivalent to putting the {@link jakarta.annotation.Priority Priority} + * annotation to an actual bean class or making a custom + * {@link jakarta.enterprise.inject.spi.Bean Bean} class implement + * {@link jakarta.enterprise.inject.spi.Prioritized Prioritized}. + *

+ * This method has no effect if the configured bean is not an alternative. + * + * @param priority the priority value + * @return self + */ + BeanConfigurator priority(int priority); + }