Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce BeanContainer.getContexts() to be able to get hold of all context objects, even if inactive #629

Merged
merged 1 commit into from
May 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@ -212,6 +213,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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @return immutable collection of {@linkplain Context context objects}; never {@code null}, but may be empty
* @return an 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