diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/BeanContainer.java b/api/src/main/java/jakarta/enterprise/inject/spi/BeanContainer.java index eb620edb..1d608b48 100644 --- a/api/src/main/java/jakarta/enterprise/inject/spi/BeanContainer.java +++ b/api/src/main/java/jakarta/enterprise/inject/spi/BeanContainer.java @@ -13,6 +13,7 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Type; +import java.util.Collection; import java.util.List; import java.util.Set; @@ -213,6 +214,15 @@ public interface BeanContainer { */ Context getContext(Class scopeType); + /** + * Obtains all {@linkplain Context context objects}, active and inactive, for the given + * {@linkplain jakarta.enterprise.context scope}. + * + * @param scopeType the {@linkplain jakarta.enterprise.context scope}; must not be {@code null} + * @return immutable collection of {@linkplain Context context objects}; never {@code null}, but may be empty + */ + Collection getContexts(Class scopeType); + /** * Returns an instance of Event with specified type java.lang.Object and specified qualifier @Default * It allows typesafe synchronous or asynchronous event firing without injection of {@link Event} built-in bean requirement.