-
Notifications
You must be signed in to change notification settings - Fork 81
add support for synthetic bean injection points #833
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| /* | ||
| * Copyright (c) 2025 Contributors to the Eclipse Foundation | ||
| * | ||
| * This program and the accompanying materials are made available under the | ||
| * Apache Software License 2.0 which is available at: | ||
| * https://www.apache.org/licenses/LICENSE-2.0. | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| package jakarta.enterprise.inject.build.compatible.spi; | ||
|
|
||
| import java.lang.annotation.Annotation; | ||
|
|
||
| import jakarta.enterprise.util.TypeLiteral; | ||
|
|
||
| /** | ||
| * Provides injectable references for injection points registered for a synthetic bean. | ||
| * A synthetic bean creation/destruction function can look up beans in this container | ||
| * that were previously registered using {@code SyntheticBeanBuilder.withInjectionPoint()}. | ||
| * <p> | ||
| * All {@code @Dependent} bean instances created by {@code SyntheticInjections} are destroyed | ||
| * when the corresponding synthetic bean instance is destroyed. | ||
| * | ||
| * @since 5.0 | ||
| */ | ||
| public interface SyntheticInjections { | ||
|
Comment on lines
+17
to
+27
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "Contains injectable references" suggests that the injectable references for injection points are always created prior to bean creation, which would in turn suggest that any Is this actually the case? If not, I suggest changing the wording to "Provides injectable references".
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't really specify whether the injectable references are created eagerly or lazily, and I think that's on purpose. I agree that "provides" is a better verb than "contains", for sure. |
||
| /** | ||
| * Returns an injectable reference to a bean of given {@code type} with given {@code qualifiers}, | ||
| * assuming an injection point with the same type and qualifiers was registered | ||
| * on the {@link SyntheticBeanBuilder}. Throws {@link IllegalArgumentException} | ||
| * if no such injection point was registered. | ||
| * <p> | ||
| * If no qualifier is passed, {@code @Default} is assumed. | ||
| * | ||
| * @param type the type of the bean to lookup, must not be {@code null} | ||
| * @param qualifiers the qualifiers of the bean to lookup, may be {@code null} or empty | ||
| * @return injectable reference to the bean; may only be {@code null} if the bean is {@code @Dependent} | ||
| * @param <T> the type of the bean to lookup | ||
| * @throws IllegalArgumentException if the type/qualifiers combination was not registered | ||
| */ | ||
| <T> T get(Class<T> type, Annotation... qualifiers); | ||
|
|
||
| /** | ||
| * Returns an injectable reference to a bean of given {@code type} with given {@code qualifiers}, | ||
| * assuming an injection point with the same type and qualifiers was registered | ||
| * on the {@link SyntheticBeanBuilder}. Throws {@link IllegalArgumentException} | ||
| * if no such injection point was registered. | ||
| * <p> | ||
| * If no qualifier is passed, {@code @Default} is assumed. | ||
| * | ||
| * @param type the type of the bean to lookup, must not be {@code null} | ||
| * @param qualifiers the qualifiers of the bean to lookup, may be {@code null} or empty | ||
| * @return injectable reference to the bean; may only be {@code null} if the bean is {@code @Dependent} | ||
| * @param <T> the type of the bean to lookup | ||
| * @throws IllegalArgumentException if the type/qualifiers combination was not registered | ||
| */ | ||
| <T> T get(TypeLiteral<T> type, Annotation... qualifiers); | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.