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

Move getInjectableReference method from BeanContainer to BeanManager #574

Merged
merged 1 commit into from
Dec 8, 2021
Merged
Show file tree
Hide file tree
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
17 changes: 0 additions & 17 deletions api/src/main/java/jakarta/enterprise/inject/spi/BeanContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import jakarta.enterprise.inject.Default;
import jakarta.enterprise.inject.Instance;
import jakarta.enterprise.inject.Stereotype;
import jakarta.enterprise.inject.UnsatisfiedResolutionException;

import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
Expand Down Expand Up @@ -57,22 +56,6 @@ public interface BeanContainer {
*/
Object getReference(Bean<?> bean, Type beanType, CreationalContext<?> ctx);

/**
* <p>
* Obtains an injectable reference for a certain {@linkplain InjectionPoint injection point}.
* </p>
*
* @param ij the target injection point
* @param ctx a {@link CreationalContext} that may be used to destroy any object with scope
* {@link Dependent} that is created
* @return the injectable reference
* @throws UnsatisfiedResolutionException if typesafe resolution results in an unsatisfied dependency
* @throws AmbiguousResolutionException typesafe resolution results in an unresolvable ambiguous dependency
* @throws IllegalStateException if called during application initialization, before the {@link AfterDeploymentValidation}
* event is fired.
*/
Object getInjectableReference(InjectionPoint ij, CreationalContext<?> ctx);

/**
* Obtain an instance of a {@link CreationalContext} for the given
* {@linkplain Contextual contextual type}, or for a non-contextual object.
Expand Down
17 changes: 17 additions & 0 deletions api/src/main/java/jakarta/enterprise/inject/spi/BeanManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
import jakarta.el.ExpressionFactory;
import jakarta.enterprise.context.Dependent;
import jakarta.enterprise.context.spi.CreationalContext;
import jakarta.enterprise.inject.AmbiguousResolutionException;
import jakarta.enterprise.inject.InjectionException;
import jakarta.enterprise.inject.UnsatisfiedResolutionException;
import jakarta.enterprise.util.Nonbinding;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
Expand Down Expand Up @@ -418,4 +420,19 @@ public <T> Bean<T> createBean(BeanAttributes<T> attributes, Class<T> beanClass,
*/
<T> InterceptionFactory<T> createInterceptionFactory(CreationalContext<T> ctx, Class<T> clazz);

/**
* <p>
* Obtains an injectable reference for a certain {@linkplain InjectionPoint injection point}.
* </p>
*
* @param ij the target injection point
* @param ctx a {@link CreationalContext} that may be used to destroy any object with scope
* {@link Dependent} that is created
* @return the injectable reference
* @throws UnsatisfiedResolutionException if typesafe resolution results in an unsatisfied dependency
* @throws AmbiguousResolutionException typesafe resolution results in an unresolvable ambiguous dependency
* @throws IllegalStateException if called during application initialization, before the {@link AfterDeploymentValidation}
* event is fired.
*/
Object getInjectableReference(InjectionPoint ij, CreationalContext<?> ctx);
}