Skip to content

Commit

Permalink
Introduce BeanContainer.getContexts() to be able to get hold of all c…
Browse files Browse the repository at this point in the history
…ontext objects, even if inactive (#629)
  • Loading branch information
manovotn committed May 23, 2023
1 parent b1f023b commit edae31c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions api/src/main/java/jakarta/enterprise/inject/spi/BeanContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -213,6 +214,15 @@ public interface BeanContainer {
*/
Context getContext(Class<? extends Annotation> 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<Context> getContexts(Class<? extends Annotation> scopeType);

/**
* Returns an instance of Event with specified type <code>java.lang.Object</code> and specified qualifier <code>@Default</code>
* It allows typesafe synchronous or asynchronous event firing without injection of {@link Event} built-in bean requirement.
Expand Down

0 comments on commit edae31c

Please sign in to comment.