From 85c41ebb869ccd3d80dc21c3e3d3b36534172e67 Mon Sep 17 00:00:00 2001
From: Eclipse CDI Bot
Date: Wed, 18 May 2022 14:49:05 +0000
Subject: [PATCH 001/113] [maven-release-plugin] prepare for next development
iteration
---
api/pom.xml | 4 ++--
lang-model/pom.xml | 2 +-
pom.xml | 4 ++--
spec/pom.xml | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/api/pom.xml b/api/pom.xml
index c7b2ddf8..b39372c5 100644
--- a/api/pom.xml
+++ b/api/pom.xml
@@ -21,7 +21,7 @@
jakarta.enterprisejakarta.enterprise.cdi-parent
- 4.0.1
+ 4.0.2-SNAPSHOTjakarta.enterprise.cdi-api
@@ -227,7 +227,7 @@
scm:git:git@github.com:cdi-spec/cdi.gitscm:git:git@github.com:cdi-spec/cdi.gitscm:git:git@github.com:cdi-spec/cdi.git
- 4.0.1
+ HEAD
diff --git a/lang-model/pom.xml b/lang-model/pom.xml
index 2afa660b..e657babe 100644
--- a/lang-model/pom.xml
+++ b/lang-model/pom.xml
@@ -4,7 +4,7 @@
jakarta.enterprisejakarta.enterprise.cdi-parent
- 4.0.1
+ 4.0.2-SNAPSHOTjakarta.enterprise.lang-model
diff --git a/pom.xml b/pom.xml
index 14090018..b218fd50 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,7 +10,7 @@
jakarta.enterprisejakarta.enterprise.cdi-parentpom
- 4.0.1
+ 4.0.2-SNAPSHOTParent module for CDI Specification
@@ -26,7 +26,7 @@
scm:git:git://github.com/eclipse-ee4j/cdi.gitscm:git:git@github.com:eclipse-ee4j/cdi.githttps://github.com/eclipse-ee4j/cdi
- 4.0.1
+ HEAD
diff --git a/spec/pom.xml b/spec/pom.xml
index 10faa507..42bbe762 100644
--- a/spec/pom.xml
+++ b/spec/pom.xml
@@ -4,7 +4,7 @@
jakarta.enterprisejakarta.enterprise.cdi-parent
- 4.0.1
+ 4.0.2-SNAPSHOTjakarta.enterprise.cdi-spec-doc
From 0b7c10abb68e16545b0542f1c74d4710e9e50df3 Mon Sep 17 00:00:00 2001
From: Ladislav Thon
Date: Tue, 24 May 2022 10:31:54 +0200
Subject: [PATCH 002/113] add BuildServicesResolver.setBuildServices()
---
.../compatible/spi/BuildServicesResolver.java | 23 +++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BuildServicesResolver.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BuildServicesResolver.java
index e5178faa..0b819539 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BuildServicesResolver.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BuildServicesResolver.java
@@ -12,12 +12,19 @@
import java.util.Collections;
import java.util.Comparator;
+import java.util.Objects;
import java.util.ServiceConfigurationError;
import java.util.ServiceLoader;
import java.util.Set;
import java.util.TreeSet;
-final class BuildServicesResolver {
+/**
+ * An internal helper to resolve {@link BuildServices} implementations.
+ * This class is public only for integrators and should not be used by applications.
+ *
+ * @since 4.0
+ */
+public final class BuildServicesResolver {
private static final Object lock = new Object();
private static volatile Set discoveredBuildServices;
private static volatile BuildServices configuredBuildServices;
@@ -48,7 +55,7 @@ private static void discoverFactories() {
BuildServices.class, BuildServicesResolver.class.getClassLoader());
if (!loader.iterator().hasNext()) {
- throw new IllegalStateException("Unable to locate AnnotationBuilderFactory implementation");
+ throw new IllegalStateException("Unable to locate BuildServices implementation");
}
try {
@@ -61,4 +68,16 @@ private static void discoverFactories() {
BuildServicesResolver.discoveredBuildServices = Collections.unmodifiableSet(factories);
}
+
+ /**
+ * This method should not be used by applications. It is only exposed for integrators
+ * with complex classloading architectures, where service loader lookup doesn't work out of the box.
+ * With this method, an integrator may manually provide an instance of {@link BuildServices} and
+ * this class will no longer attempt to look it up using service loader.
+ *
+ * @param instance a {@link BuildServices} instance that should be used, must not be {@code null}
+ */
+ public static void setBuildServices(BuildServices instance) {
+ configuredBuildServices = Objects.requireNonNull(instance, "BuildServices instance must not be null");
+ }
}
From 004f7489622e573add545b245c40c8b665dfa684 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Thu, 26 May 2022 18:56:30 -0500
Subject: [PATCH 003/113] Bump nokogiri from 1.13.4 to 1.13.6 in /docs (#614)
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.4 to 1.13.6.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.13.4...v1.13.6)
---
updated-dependencies:
- dependency-name: nokogiri
dependency-type: indirect
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
docs/Gemfile.lock | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock
index 1b6b017b..2cc62c7b 100644
--- a/docs/Gemfile.lock
+++ b/docs/Gemfile.lock
@@ -229,9 +229,9 @@ GEM
jekyll-seo-tag (~> 2.1)
minitest (5.15.0)
multipart-post (2.1.1)
- nokogiri (1.13.4-x86_64-darwin)
+ nokogiri (1.13.6-x86_64-darwin)
racc (~> 1.4)
- nokogiri (1.13.4-x86_64-linux)
+ nokogiri (1.13.6-x86_64-linux)
racc (~> 1.4)
octokit (4.22.0)
faraday (>= 0.9)
From 82ec5d71872212364a321cd3700d0ecadf9162d2 Mon Sep 17 00:00:00 2001
From: Matej Novotny
Date: Wed, 25 May 2022 16:49:56 +0200
Subject: [PATCH 004/113] Make sure CDI and BuildServicesResolves both guard
against repeated invocations of set method
---
.../build/compatible/spi/BuildServicesResolver.java | 12 ++++++++++--
.../main/java/jakarta/enterprise/inject/spi/CDI.java | 10 +++++++---
2 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BuildServicesResolver.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BuildServicesResolver.java
index 0b819539..702bf860 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BuildServicesResolver.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BuildServicesResolver.java
@@ -12,7 +12,6 @@
import java.util.Collections;
import java.util.Comparator;
-import java.util.Objects;
import java.util.ServiceConfigurationError;
import java.util.ServiceLoader;
import java.util.Set;
@@ -76,8 +75,17 @@ private static void discoverFactories() {
* this class will no longer attempt to look it up using service loader.
*
* @param instance a {@link BuildServices} instance that should be used, must not be {@code null}
+ * @throws IllegalArgumentException if the provided argument is null
+ * @throws IllegalStateException if the {@link BuildServices} are already set
*/
public static void setBuildServices(BuildServices instance) {
- configuredBuildServices = Objects.requireNonNull(instance, "BuildServices instance must not be null");
+ if (instance == null) {
+ throw new IllegalArgumentException("BuildServices instance must not be null");
+ }
+ if (configuredBuildServices != null) {
+ configuredBuildServices = instance;
+ } else {
+ throw new IllegalStateException("BuildServices cannot be set repeatedly. Existing BuildServices are " + configuredBuildServices);
+ }
}
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/CDI.java b/api/src/main/java/jakarta/enterprise/inject/spi/CDI.java
index b50f192d..f044a75a 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/CDI.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/CDI.java
@@ -68,7 +68,7 @@ public static CDI
*
* @return the declaring {@linkplain Bean bean}
+ * @since 4.0
*/
default Bean> getDeclaringBean() {
return null;
From b3ff5320a0e74eb69a1ff8e728fcb7e1f9194da7 Mon Sep 17 00:00:00 2001
From: Ladislav Thon
Date: Tue, 25 Apr 2023 17:14:40 +0200
Subject: [PATCH 014/113] improve wording of event type assignability rules
This paragraph used to have a few sentences that used terms from
the bean type assignability part of the specification, which is
inappropriate for this part of the specification.
---
spec/src/main/asciidoc/core/events.asciidoc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/spec/src/main/asciidoc/core/events.asciidoc b/spec/src/main/asciidoc/core/events.asciidoc
index b18fd183..5c9a1805 100644
--- a/spec/src/main/asciidoc/core/events.asciidoc
+++ b/spec/src/main/asciidoc/core/events.asciidoc
@@ -219,9 +219,9 @@ If the runtime type of the event object contains an unresolvable type variable,
==== Assignability of type variables, raw and parameterized types
-An event type is considered assignable to a type variable if the event type is assignable to the upper bound, if any.
+An event type is considered assignable to an observed event type that is a type variable if the event type is assignable to the upper bound of the type variable, if any.
-A raw event type is considered assignable to a parameterized observed event type if the raw types are identical and all type parameters of the required type are either unbounded type variables or `java.lang.Object`.
+A raw event type is considered assignable to a parameterized observed event type if the raw types are identical and all type parameters of the observed event type are either unbounded type variables or `java.lang.Object`.
A parameterized event type is considered assignable to a raw observed event type if the raw types are identical.
From 9f70b15c97a6ebe01b0acf7da185c1ccb9bbd9db Mon Sep 17 00:00:00 2001
From: Ladislav Thon
Date: Tue, 25 Apr 2023 17:17:30 +0200
Subject: [PATCH 015/113] make the section about interceptors with disposer
methods more precise
---
spec/src/main/asciidoc/core/implementation.asciidoc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/spec/src/main/asciidoc/core/implementation.asciidoc b/spec/src/main/asciidoc/core/implementation.asciidoc
index f4611cc5..4b41305b 100644
--- a/spec/src/main/asciidoc/core/implementation.asciidoc
+++ b/spec/src/main/asciidoc/core/implementation.asciidoc
@@ -379,7 +379,7 @@ If a method has more than one parameter annotated `@Disposes`, the container aut
If a disposer method is annotated `@Produces` or `@Inject`, has a parameter annotated `@Observes` or has a parameter annotated `@ObservesAsync`, the container automatically detects the problem and treats it as a definition error.
Interceptors may not declare disposer methods.
-If an interceptor has a method annotated `@Disposes`, the container automatically detects the problem and treats it as a definition error.
+If an interceptor has a method that has a parameter annotated `@Disposes`, the container automatically detects the problem and treats it as a definition error.
In addition to the disposed parameter, a disposer method may declare additional parameters, which may also specify qualifiers.
These additional parameters are injection points.
From cbcc72da28f9ffe99d5c116c1236bddf4b4fb885 Mon Sep 17 00:00:00 2001
From: Ladislav Thon
Date: Tue, 25 Apr 2023 17:19:17 +0200
Subject: [PATCH 016/113] use a more appropriate link to the enablement section
in CDI Full
---
spec/src/main/asciidoc/core/inheritance_full.asciidoc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/spec/src/main/asciidoc/core/inheritance_full.asciidoc b/spec/src/main/asciidoc/core/inheritance_full.asciidoc
index dec2836a..15170b66 100644
--- a/spec/src/main/asciidoc/core/inheritance_full.asciidoc
+++ b/spec/src/main/asciidoc/core/inheritance_full.asciidoc
@@ -128,7 +128,7 @@ public class MockAsynchronousService extends AsynchronousService {
}
----
-When an enabled bean, as defined in <>, specializes a second bean, we can be certain that the second bean is never instantiated or called by the container.
+When an enabled bean, as defined in <>, specializes a second bean, we can be certain that the second bean is never instantiated or called by the container.
Even if the second bean defines a producer or observer method, the method will never be called.
[[direct_and_indirect_specialization]]
From b1f023ba543df190b1ae103b706d78a2114c560a Mon Sep 17 00:00:00 2001
From: Scott M Stark
Date: Tue, 23 May 2023 03:08:01 -0500
Subject: [PATCH 017/113] Address the javadoc errors under jdk17 (#672)
* Address the javadoc errors under jdk17, #671
* Add Java 17 to the actions matrix
Signed-off-by: Scott M Stark
---
.github/workflows/ci-actions.yml | 3 +--
api/src/main/java/jakarta/decorator/package-info.java | 6 +++---
.../java/jakarta/enterprise/context/package-info.java | 6 +++---
.../main/java/jakarta/enterprise/event/Observes.java | 2 +-
.../java/jakarta/enterprise/event/package-info.java | 6 +++---
.../jakarta/enterprise/inject/spi/package-info.java | 10 +++++-----
6 files changed, 16 insertions(+), 17 deletions(-)
diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml
index 7cdcbf0a..0f29c5a6 100644
--- a/.github/workflows/ci-actions.yml
+++ b/.github/workflows/ci-actions.yml
@@ -11,8 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- java:
- - 11
+ java: [ '11', '17' ]
steps:
- uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java }}
diff --git a/api/src/main/java/jakarta/decorator/package-info.java b/api/src/main/java/jakarta/decorator/package-info.java
index 94bdde62..4610ed95 100644
--- a/api/src/main/java/jakarta/decorator/package-info.java
+++ b/api/src/main/java/jakarta/decorator/package-info.java
@@ -32,7 +32,7 @@
* for which interceptors are optimized. Decorators are called
* after interceptors.
*
- *
Decorated types
+ *
Decorated types
*
*
The set of decorated types of a decorator includes all
* bean types of the managed bean that are Java interfaces,
@@ -49,7 +49,7 @@
*
A decorator may be an abstract class, and is not required to
* implement every method of every decorated type.
*
- *
Delegate injection points
+ *
Delegate injection points
*
*
All decorators have a
* {@linkplain jakarta.decorator.Delegate delegate injection point}.
@@ -60,7 +60,7 @@
* extend every decorated type. A decorator is not required to
* implement the type of the delegate injection point.
*
- *
Enabled decorators
+ *
Enabled decorators
*
*
By default, a bean archive has no enabled decorators. A
* decorator must be explicitly enabled by listing its bean class
diff --git a/api/src/main/java/jakarta/enterprise/context/package-info.java b/api/src/main/java/jakarta/enterprise/context/package-info.java
index b2e2232d..86e701e4 100644
--- a/api/src/main/java/jakarta/enterprise/context/package-info.java
+++ b/api/src/main/java/jakarta/enterprise/context/package-info.java
@@ -29,7 +29,7 @@
* bean
*
*
- *
Built-in scopes
+ *
Built-in scopes
*
*
The following built-in scopes are provided:
* {@link jakarta.enterprise.context.Dependent @Dependent},
@@ -57,7 +57,7 @@
* method invocations or to asynchronous processes such as JMS message
* listeners or EJB timer service timeouts.
*
- *
Normal scopes and pseudo-scopes
+ *
Normal scopes and pseudo-scopes
*
*
Most scopes are normal scopes. Normal scopes are declared
* using {@link jakarta.enterprise.context.NormalScope @NormalScope}.
@@ -80,7 +80,7 @@
* {@link jakarta.enterprise.context.Dependent @Dependent} and
* {@link jakarta.inject.Singleton @Singleton} pseudo-scopes.
*
- *
Contextual and injected reference validity
+ *
Contextual and injected reference validity
*
*
A reference to a bean obtained from the container via {@linkplain
* jakarta.enterprise.inject.Instance programmatic lookup} is called a
diff --git a/api/src/main/java/jakarta/enterprise/event/Observes.java b/api/src/main/java/jakarta/enterprise/event/Observes.java
index 20175f55..c1d9ea4c 100644
--- a/api/src/main/java/jakarta/enterprise/event/Observes.java
+++ b/api/src/main/java/jakarta/enterprise/event/Observes.java
@@ -105,8 +105,8 @@
*
*
* By default, the observer method is notified when the event is fired.
- * @return phase of the transaction
*
+ * @return phase of the transaction
*/
public TransactionPhase during() default TransactionPhase.IN_PROGRESS;
}
diff --git a/api/src/main/java/jakarta/enterprise/event/package-info.java b/api/src/main/java/jakarta/enterprise/event/package-info.java
index d3e87e0a..1f0f9450 100644
--- a/api/src/main/java/jakarta/enterprise/event/package-info.java
+++ b/api/src/main/java/jakarta/enterprise/event/package-info.java
@@ -37,7 +37,7 @@
*
The {@link jakarta.enterprise.event.Event} interface is used to
* fire events.
*
- *
Event objects and event types
+ *
Event objects and event types
*
*
The event object acts as a payload, to propagate state from
* producer to consumer. An event object is an instance of a concrete
@@ -47,13 +47,13 @@
* interfaces of the runtime class of the event object. An event type
* may not contain a type variable.
*
- *
Event qualifiers
+ *
Event qualifiers
*
*
The event qualifiers act as topic selectors, allowing the consumer
* to narrow the set of events it observes. An event qualifier may be an
* instance of any {@linkplain jakarta.inject.Qualifier qualifier type}.
*
- *
Observer methods
+ *
Observer methods
*
*
An {@linkplain jakarta.enterprise.event.Observes observer method}
* allows the application to receive and respond synchronously to event notifications.
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/package-info.java b/api/src/main/java/jakarta/enterprise/inject/spi/package-info.java
index f4ec428d..cb611f1f 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/package-info.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/package-info.java
@@ -28,7 +28,7 @@
* metadata from some other source
*
*
- *
The BeanManager object
+ *
The BeanManager object
*
*
Portable extensions sometimes interact directly with the container
* via programmatic API call. The interface
@@ -36,7 +36,7 @@
* for obtaining contextual references for beans, along with many other
* operations of use to portable extensions.
*
- *
Container lifecycle events
+ *
Container lifecycle events
*
*
During the application initialization process, the container fires
* a series of {@linkplain jakarta.enterprise.event events}, allowing
@@ -51,7 +51,7 @@
* {@link jakarta.enterprise.inject.spi.AfterDeploymentValidation} and
* {@link jakarta.enterprise.inject.spi.BeforeShutdown}.
*
- *
Interfaces representing enabled beans
+ *
Interfaces representing enabled beans
*
*
The interfaces
* {@link jakarta.enterprise.inject.spi.Bean},
@@ -83,7 +83,7 @@
* observing the event type
* {@link jakarta.enterprise.inject.spi.ProcessObserverMethod}.
*
- *
Alternate metadata sources
+ *
Alternate metadata sources
*
*
A portable extension may provide an alternative metadata
* source, such as configuration by XML.
The interfaces {@link jakarta.enterprise.inject.spi.Producer} and
* {@link jakarta.enterprise.inject.spi.InjectionTarget} abstract the
From edae31c4629c77a44ef6814d3da57fa0886dbec0 Mon Sep 17 00:00:00 2001
From: Matej Novotny
Date: Tue, 23 May 2023 16:37:02 +0200
Subject: [PATCH 018/113] Introduce BeanContainer.getContexts() to be able to
get hold of all context objects, even if inactive (#629)
---
.../jakarta/enterprise/inject/spi/BeanContainer.java | 10 ++++++++++
1 file changed, 10 insertions(+)
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 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 getContexts(Class extends Annotation> 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.
From 96cd940c60e30456f47645fd9f57021eba561f3e Mon Sep 17 00:00:00 2001
From: Ladislav Thon
Date: Wed, 24 May 2023 10:09:07 +0200
Subject: [PATCH 019/113] Improve AnnotationLiteral javadoc (#657)
---
api/src/main/java/jakarta/enterprise/util/AnnotationLiteral.java | 1 +
1 file changed, 1 insertion(+)
diff --git a/api/src/main/java/jakarta/enterprise/util/AnnotationLiteral.java b/api/src/main/java/jakarta/enterprise/util/AnnotationLiteral.java
index e77d34fb..a9d8cdc7 100644
--- a/api/src/main/java/jakarta/enterprise/util/AnnotationLiteral.java
+++ b/api/src/main/java/jakarta/enterprise/util/AnnotationLiteral.java
@@ -38,6 +38,7 @@
*
*
* An instance of an annotation type may be obtained by subclassing AnnotationLiteral.
+ * The subclass must implement the annotation interface to satisfy the {@link Annotation} contract.
*
*
*
From 820ad5dbc6c941aa195ea078a2f13b654591442b Mon Sep 17 00:00:00 2001
From: Ladislav Thon
Date: Wed, 24 May 2023 11:54:35 +0200
Subject: [PATCH 020/113] Fix missing wording about priority on stereotypes
(#674)
---
spec/src/main/asciidoc/core/injectionandresolution.asciidoc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/spec/src/main/asciidoc/core/injectionandresolution.asciidoc b/spec/src/main/asciidoc/core/injectionandresolution.asciidoc
index 9905f894..b737057e 100644
--- a/spec/src/main/asciidoc/core/injectionandresolution.asciidoc
+++ b/spec/src/main/asciidoc/core/injectionandresolution.asciidoc
@@ -45,7 +45,8 @@ An alternative is not available for injection, lookup or name resolution to clas
An alternative may be given a priority for the application:
* by placing the `@Priority` annotation on the bean class of a managed bean, or
-* by placing the `@Priority` annotation on the bean class that declares the producer method, field or resource.
+* by placing the `@Priority` annotation on the bean class that declares the producer method, field or resource, or
+* by placing the `@Priority` annotation on a stereotype that is applied to the bean class, producer method or producer field.
[[enablement]]
From 3c95b0fd00d5af12cedac9ae8d2c0b7382bad91f Mon Sep 17 00:00:00 2001
From: Ladislav Thon
Date: Wed, 24 May 2023 17:46:42 +0200
Subject: [PATCH 021/113] Bump CDI version to 4.1 and place EL integration API
in a new supplemental artifact (#644)
* Fix remnants of BeanManager.fireEvent() removal
* Centralize common Maven properties in the parent POM
* Fix EL import version in bundle metadata
* Bump CDI version to 4.1
* Place the EL integration API to ELAwareBeanManager in a new supplemental API artifact
The existing EL integration API in `BeanManager` is deprecated for removal.
---
api/pom.xml | 29 ++--
.../enterprise/inject/spi/BeanManager.java | 7 +-
.../enterprise/inject/spi/EventMetadata.java | 3 +-
el/pom.xml | 147 ++++++++++++++++++
.../inject/spi/el/ELAwareBeanManager.java | 34 ++++
el/src/main/java/module-info.java | 6 +
.../main/javadoc/doc-files/speclicense.html | 72 +++++++++
el/src/main/javadoc/overview.html | 11 ++
lang-model/pom.xml | 19 +--
pom.xml | 13 +-
spec/pom.xml | 2 +-
spec/src/main/asciidoc/cdi-spec.asciidoc | 4 +-
spec/src/main/asciidoc/core/events.asciidoc | 4 +-
spec/src/main/asciidoc/core/spi_full.asciidoc | 11 --
.../asciidoc/javaee/definition_ee.asciidoc | 2 +-
spec/src/main/asciidoc/javaee/el.asciidoc | 46 ++++++
.../javaee/javaeeintegration.asciidoc | 2 +
.../javaee/packagingdeployment_ee.asciidoc | 10 --
spec/src/main/asciidoc/javaee/spi_ee.asciidoc | 11 --
spec/src/main/asciidoc/preface.asciidoc | 7 +-
20 files changed, 366 insertions(+), 74 deletions(-)
create mode 100644 el/pom.xml
create mode 100644 el/src/main/java/jakarta/enterprise/inject/spi/el/ELAwareBeanManager.java
create mode 100644 el/src/main/java/module-info.java
create mode 100644 el/src/main/javadoc/doc-files/speclicense.html
create mode 100644 el/src/main/javadoc/overview.html
create mode 100644 spec/src/main/asciidoc/javaee/el.asciidoc
diff --git a/api/pom.xml b/api/pom.xml
index ffcf534e..94405952 100644
--- a/api/pom.xml
+++ b/api/pom.xml
@@ -21,7 +21,7 @@
jakarta.enterprisejakarta.enterprise.cdi-parent
- 4.0.2-SNAPSHOT
+ 4.1.0-SNAPSHOTjakarta.enterprise.cdi-api
@@ -128,12 +128,6 @@
2.0.15.0.02.1.0
-
- 11
- 5.1.2
- 3.3.0
- 3.0.0-M5
- UTF-8
@@ -289,8 +283,9 @@
+ org.apache.maven.pluginsmaven-compiler-plugin
- 3.8.1
+ ${maven-compiler-plugin.version}-Xlint:all
@@ -314,11 +309,11 @@
jakarta.cdi
- jakarta.decorator;version=4.0,
- jakarta.enterprise.*;version=4.0,
+ jakarta.decorator;version=4.1,
+ jakarta.enterprise.*;version=4.1,
- jakarta.el; version=4.0,
+ jakarta.el;version=5.0,
*
@@ -328,7 +323,7 @@
org.apache.maven.pluginsmaven-jar-plugin
- 3.2.0
+ ${maven-jar-plugin.version}${project.build.outputDirectory}/META-INF/MANIFEST.MF
@@ -375,14 +370,14 @@
org.apache.maven.pluginsmaven-javadoc-plugin
- ${maven-javadoc-plugin}
+ ${maven-javadoc-plugin.version}true
- Jakarta Context Dependency Injection API
- Jakarta Context Dependency Injection API
+ Jakarta Contexts and Dependency Injection API
+ Jakarta Contexts and Dependency Injection APIfalse
- Jakarta Context Dependency Injection API
- Jakarta Context Dependency Injection ${project.version}]]>
+ Jakarta Contexts and Dependency Injection API
+ Jakarta Contexts and Dependency Injection ${project.version}]]>
cdi-dev@eclipse.org.
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/BeanManager.java b/api/src/main/java/jakarta/enterprise/inject/spi/BeanManager.java
index 2224ae64..d70548ba 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/BeanManager.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/BeanManager.java
@@ -227,9 +227,11 @@ public interface BeanManager extends BeanContainer {
/**
* Returns a {@link jakarta.el.ELResolver} that resolves beans by EL name.
- *
+ *
+ * @deprecated use {@code ELAwareBeanManager}, this method will be removed in CDI 5.0
* @return the {@link jakarta.el.ELResolver}
*/
+ @Deprecated(since = "4.1", forRemoval = true)
public ELResolver getELResolver();
/**
@@ -239,10 +241,11 @@ public interface BeanManager extends BeanContainer {
* {@link jakarta.el.ExpressionFactory}, the container handles destruction of objects with scope
* {@link Dependent}.
*
- *
+ * @deprecated use {@code ELAwareBeanManager}, this method will be removed in CDI 5.0
* @param expressionFactory the {@link jakarta.el.ExpressionFactory} to wrap
* @return the wrapped {@link jakarta.el.ExpressionFactory}
*/
+ @Deprecated(since = "4.1", forRemoval = true)
public ExpressionFactory wrapExpressionFactory(ExpressionFactory expressionFactory);
/**
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/EventMetadata.java b/api/src/main/java/jakarta/enterprise/inject/spi/EventMetadata.java
index c8e5c2e2..8889e962 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/EventMetadata.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/EventMetadata.java
@@ -25,8 +25,7 @@
/**
*
- * Provides access to metadata about an observed event payload. The metadata may be for events fired with either of
- * {@link Event} or {@link BeanManager#getEvent()}
+ * Provides access to metadata about an observed event payload.
*
By using and/or copying this document, or the Eclipse Foundation
+ document from which this statement is linked, you (the licensee) agree
+ that you have read, understood, and will comply with the following
+ terms and conditions:
+
+
Permission to copy, and distribute the contents of this document, or
+ the Eclipse Foundation document from which this statement is linked, in
+ any medium for any purpose and without fee or royalty is hereby
+ granted, provided that you include the following on ALL copies of the
+ document, or portions thereof, that you use:
+
+
+
link or URL to the original Eclipse Foundation document.
Inclusion of the full text of this NOTICE must be provided. We
+ request that authorship attribution be provided in any software,
+ documents, or other items or products that you create pursuant to the
+ implementation of the contents of this document, or any portion
+ thereof.
+
+
No right to create modifications or derivatives of Eclipse Foundation
+ documents is granted pursuant to this license, except anyone may
+ prepare and distribute derivative works and portions of this document
+ in software that implements the specification, in supporting materials
+ accompanying such software, and in documentation of such software,
+ PROVIDED that all such works include the notice below. HOWEVER, the
+ publication of derivative works of this document for use as a technical
+ specification is expressly prohibited.
THIS DOCUMENT IS PROVIDED "AS IS," AND THE COPYRIGHT
+ HOLDERS AND THE ECLIPSE FOUNDATION MAKE NO REPRESENTATIONS OR
+ WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+ WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
+ NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS OF THE DOCUMENT ARE
+ SUITABLE FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF SUCH CONTENTS
+ WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR
+ OTHER RIGHTS.
+
+
THE COPYRIGHT HOLDERS AND THE ECLIPSE FOUNDATION WILL NOT BE LIABLE
+ FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT
+ OF ANY USE OF THE DOCUMENT OR THE PERFORMANCE OR IMPLEMENTATION OF THE
+ CONTENTS THEREOF.
+
+
The name and trademarks of the copyright holders or the Eclipse
+ Foundation may NOT be used in advertising or publicity pertaining to
+ this document or its contents without specific, written prior
+ permission. Title to copyright in this document will at all times
+ remain with copyright holders.
+
+
+
\ No newline at end of file
diff --git a/el/src/main/javadoc/overview.html b/el/src/main/javadoc/overview.html
new file mode 100644
index 00000000..ac47e9d4
--- /dev/null
+++ b/el/src/main/javadoc/overview.html
@@ -0,0 +1,11 @@
+
+
+
+
+
The CDI EL integration API enables CDI integration with Unified EL.
+The integration entrypoint is an ELAwareBeanManager, which allows
+obtaining a CDI-aware EL resolver and wrapping an EL expression factory into a CDI-aware one.
+
+
+
+
diff --git a/lang-model/pom.xml b/lang-model/pom.xml
index a7764cf1..8a580e4d 100644
--- a/lang-model/pom.xml
+++ b/lang-model/pom.xml
@@ -4,7 +4,7 @@
jakarta.enterprisejakarta.enterprise.cdi-parent
- 4.0.2-SNAPSHOT
+ 4.1.0-SNAPSHOTjakarta.enterprise.lang-model
@@ -21,14 +21,6 @@
-
- 11
- 5.1.2
- 3.2.0
- 2.22.0
- UTF-8
-
-
@@ -46,8 +38,9 @@
+ org.apache.maven.pluginsmaven-compiler-plugin
- 3.8.1
+ ${maven-compiler-plugin.version}-Xlint:all
@@ -70,7 +63,7 @@
- jakarta.enterprise.lang.model.*;version=4.0,
+ jakarta.enterprise.lang.model.*;version=4.1,
@@ -79,7 +72,7 @@
org.apache.maven.pluginsmaven-jar-plugin
- 3.2.0
+ ${maven-jar-plugin.version}${project.build.outputDirectory}/META-INF/MANIFEST.MF
@@ -89,7 +82,7 @@
org.apache.maven.pluginsmaven-javadoc-plugin
- ${maven-javadoc-plugin}
+ ${maven-javadoc-plugin.version}trueJakarta CDI Language Model
diff --git a/pom.xml b/pom.xml
index 2c09af90..f196ef19 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,7 +10,7 @@
jakarta.enterprisejakarta.enterprise.cdi-parentpom
- 4.0.2-SNAPSHOT
+ 4.1.0-SNAPSHOTParent module for CDI Specification
@@ -33,12 +33,23 @@
speclang-modelapi
+ elclean package
+ UTF-8
+
+ 11
+
+ 5.1.2
+ 3.8.1
+ 3.2.0
+ 3.3.0
+ 3.0.0-M5
+
https://jakarta.oss.sonatype.org/${sonatypeOssDistMgmtNexusUrl}content/repositories/staging/
diff --git a/spec/pom.xml b/spec/pom.xml
index 42bbe762..02b9de90 100644
--- a/spec/pom.xml
+++ b/spec/pom.xml
@@ -4,7 +4,7 @@
jakarta.enterprisejakarta.enterprise.cdi-parent
- 4.0.2-SNAPSHOT
+ 4.1.0-SNAPSHOTjakarta.enterprise.cdi-spec-doc
diff --git a/spec/src/main/asciidoc/cdi-spec.asciidoc b/spec/src/main/asciidoc/cdi-spec.asciidoc
index aaecdf30..9f977403 100644
--- a/spec/src/main/asciidoc/cdi-spec.asciidoc
+++ b/spec/src/main/asciidoc/cdi-spec.asciidoc
@@ -1,8 +1,8 @@
= Jakarta Contexts and Dependency Injection
:author: Jakarta Contexts and Dependency Injection Specification Project
:email: cdi-dev@eclipse.org
-:revnumber: 4.0
-:revdate: Feburary 7 2022
+:revnumber: 4.1
+:revdate: May 24 2023
:revremark: Draft
:version-label!:
:sectanchors:
diff --git a/spec/src/main/asciidoc/core/events.asciidoc b/spec/src/main/asciidoc/core/events.asciidoc
index 5c9a1805..a743cb23 100644
--- a/spec/src/main/asciidoc/core/events.asciidoc
+++ b/spec/src/main/asciidoc/core/events.asciidoc
@@ -530,7 +530,7 @@ Observer methods may throw exceptions:
Exception management during an asynchronous event is defined in <>.
* Otherwise, the exception aborts processing of the event.
No other observer methods of that event will be called.
-The `BeanManager.getEvent()` or `Event.fire()` method rethrows the exception.
+The `Event.fire()` method rethrows the exception.
If the exception is a checked exception, it is wrapped and rethrown as an (unchecked) `ObserverException`.
@@ -588,7 +588,7 @@ The transaction context and lifecycle contexts active when an observer method is
As specified in <>, contexts associated with built-in normal scope don't propagate across asynchronous observers.
* If the observer method is a before completion transactional observer method, it is called within the context of the transaction that is about to complete and with the same lifecycle contexts.
* Otherwise, if the observer method is any other kind of transactional observer method, it is called in an unspecified transaction context, but with the same lifecycle contexts as the transaction that just completed.
-* Otherwise, the observer method is called in the same transaction context and lifecycle contexts as the invocation of `Event.fire()` or `BeanManager.getEvent()`.
+* Otherwise, the observer method is called in the same transaction context and lifecycle contexts as the invocation of `Event.fire()`.
[[observable_container_lifecycle_events]]
diff --git a/spec/src/main/asciidoc/core/spi_full.asciidoc b/spec/src/main/asciidoc/core/spi_full.asciidoc
index a88ac8e8..d58c81ca 100644
--- a/spec/src/main/asciidoc/core/spi_full.asciidoc
+++ b/spec/src/main/asciidoc/core/spi_full.asciidoc
@@ -389,17 +389,6 @@ public int getQualifierHashCode(Annotation qualifier);
public int getInterceptorBindingHashCode(Annotation interceptorBinding);
----
-[[bm_obtain_elresolver]]
-
-==== Obtaining the `ELResolver`
-
-The method `BeanManager.getELResolver()` returns the `jakarta.el.ELResolver` specified in <>.
-
-[source, java]
-----
-public ELResolver getELResolver();
-----
-
[[bm_obtain_annotatedtype]]
==== Obtaining an `AnnotatedType` for a class
diff --git a/spec/src/main/asciidoc/javaee/definition_ee.asciidoc b/spec/src/main/asciidoc/javaee/definition_ee.asciidoc
index 74e615ba..b01c1fd3 100644
--- a/spec/src/main/asciidoc/javaee/definition_ee.asciidoc
+++ b/spec/src/main/asciidoc/javaee/definition_ee.asciidoc
@@ -74,7 +74,7 @@ A bean with a name may be referred to by its name in Unified EL expressions.
There is no relationship between the bean name of an EJB session bean and the EJB name of the bean.
-Bean names allow the direct use of beans in JSP or JSF pages, as defined in <>.
+Bean names allow the direct use of beans in JSP or JSF pages.
For example, a bean with the name `products` could be used like this:
[source, xml]
diff --git a/spec/src/main/asciidoc/javaee/el.asciidoc b/spec/src/main/asciidoc/javaee/el.asciidoc
new file mode 100644
index 00000000..3eef88ae
--- /dev/null
+++ b/spec/src/main/asciidoc/javaee/el.asciidoc
@@ -0,0 +1,46 @@
+[[el]]
+== Integration with Unified EL
+
+[[el_resolution]]
+=== Bean name resolution in EL expressions
+
+The container must provide a Unified EL `ELResolver` to the servlet engine and JSF implementation that resolves bean names using the rules of name resolution defined in <> and resolving ambiguities according to <>.
+
+* If a name used in an EL expression does not resolve to any bean, the `ELResolver` must return a null value.
+* Otherwise, if a name used in an EL expression resolves to exactly one bean, the `ELResolver` must return a contextual instance of the bean, as defined in <>.
+
+[[el_support]]
+=== Unified EL integration API
+
+Since CDI version 4.1, the Unified EL integration API, which is part of the `BeanManager` API, is deprecated.
+The relevant methods are placed in a new interface `jakarta.enterprise.inject.spi.el.ELAwareBeanManager`, which is present in a new supplemental CDI API artifact: `jakarta.enterprise:jakarta.enterprise.cdi-el-api`.
+
+==== Obtaining `ELAwareBeanManager`
+
+The `BeanManager` implementation in Jakarta EE must also implement `ELAwareBeanManager`.
+All rules that apply to the `BeanManager`, as specified in <> and <>, also apply to `ELAwareBeanManager`.
+
+It follows that the container provides a built-in bean with bean type `ELAwareBeanManager`, scope `@Dependent` and qualifier `@Default`, which is a passivation capable dependency as defined in <>.
+It also follows that an `ELAwareBeanManager` may be obtained by using `CDI.current().getBeanManager()` and casting.
+
+The EL-related methods of `ELAwareBeanManager` may be called at any time during the execution of the application.
+
+==== Obtaining the `ELResolver`
+
+The method `ELAwareBeanManager.getELResolver()` returns the `jakarta.el.ELResolver` specified in <>.
+This `ELResolver` is used to satisfy the rules defined in <>.
+
+[source, java]
+----
+public ELResolver getELResolver();
+----
+
+==== Wrapping a Unified EL `ExpressionFactory`
+
+The method `ELAwareBeanManager.wrapExpressionFactory()` returns a wrapper `jakarta.el.ExpressionFactory` that delegates `MethodExpression` and `ValueExpression` creation to the given `ExpressionFactory`.
+When a Unified EL expression is evaluated using a `MethodExpression` or `ValueExpression` returned by the wrapper `ExpressionFactory`, the rules defined in <> are enforced by the container.
+
+[source, java]
+----
+public ExpressionFactory wrapExpressionFactory(ExpressionFactory expressionFactory);
+----
diff --git a/spec/src/main/asciidoc/javaee/javaeeintegration.asciidoc b/spec/src/main/asciidoc/javaee/javaeeintegration.asciidoc
index e05509ba..fbe81db6 100644
--- a/spec/src/main/asciidoc/javaee/javaeeintegration.asciidoc
+++ b/spec/src/main/asciidoc/javaee/javaeeintegration.asciidoc
@@ -27,3 +27,5 @@ include::events_ee.asciidoc[]
include::spi_ee.asciidoc[]
include::packagingdeployment_ee.asciidoc[]
+
+include::el.asciidoc[]
diff --git a/spec/src/main/asciidoc/javaee/packagingdeployment_ee.asciidoc b/spec/src/main/asciidoc/javaee/packagingdeployment_ee.asciidoc
index d0f95b5c..759e31e3 100644
--- a/spec/src/main/asciidoc/javaee/packagingdeployment_ee.asciidoc
+++ b/spec/src/main/asciidoc/javaee/packagingdeployment_ee.asciidoc
@@ -56,13 +56,3 @@ When running in Jakarta EE, the container must extend the rules defined in <> and must ensure that EJB session beans are not removed from the set of discovered types.
-
-
-[[el]]
-
-=== Integration with Unified EL
-
-The container must provide a Unified EL `ELResolver` to the servlet engine and JSF implementation that resolves bean names using the rules of name resolution defined in <> and resolving ambiguities according to <>.
-
-* If a name used in an EL expression does not resolve to any bean, the `ELResolver` must return a null value.
-* Otherwise, if a name used in an EL expression resolves to exactly one bean, the `ELResolver` must return a contextual instance of the bean, as defined in <>.
diff --git a/spec/src/main/asciidoc/javaee/spi_ee.asciidoc b/spec/src/main/asciidoc/javaee/spi_ee.asciidoc
index 19902098..8493fa46 100644
--- a/spec/src/main/asciidoc/javaee/spi_ee.asciidoc
+++ b/spec/src/main/asciidoc/javaee/spi_ee.asciidoc
@@ -40,17 +40,6 @@ A Jakarta EE container is required to provide a CDI provider that will allow acc
Jakarta EE Components may obtain an instance of `BeanManager` from JNDI by looking up the name `java:comp/BeanManager`.
-[[bm_wrap_expressionfactory]]
-
-==== Wrapping a Unified EL `ExpressionFactory`
-
-The method `BeanManager.wrapExpressionFactory()` returns a wrapper `jakarta.el.ExpressionFactory` that delegates `MethodExpression` and `ValueExpression` creation to the given `ExpressionFactory`. When a Unified EL expression is evaluated using a `MethodExpression` or `ValueExpression` returned by the wrapper `ExpressionFactory`, the rules defined in <> are enforced by the container.
-
-[source, java]
-----
-public ExpressionFactory wrapExpressionFactory(ExpressionFactory expressionFactory);
-----
-
[[alternative_metadata_sources_ee]]
=== Alternative metadata sources and EJB
diff --git a/spec/src/main/asciidoc/preface.asciidoc b/spec/src/main/asciidoc/preface.asciidoc
index d14a4b77..233a74e5 100644
--- a/spec/src/main/asciidoc/preface.asciidoc
+++ b/spec/src/main/asciidoc/preface.asciidoc
@@ -24,6 +24,11 @@ This document is organized in 4 parts:
=== Major changes
+==== Jakarta Contexts and Dependency Injection 4.1
+
+link:https://jakarta.ee/specifications/cdi/4.1/[CDI 4.1] deprecates the Unified EL integration API in `BeanManager` and places the relevant methods to a dedicated interface `ELAwareBeanManager`, which is present in a new supplemental API artifact: `jakarta.enterprise:jakarta.enterprise.cdi-el-api`.
+This supplemental artifact declares a JPMS module `jakarta.cdi.el`, which declares a dependency on `jakarta.cdi` and `jakarta.el`.
+
==== Jakarta Contexts and Dependency Injection 4.0
link:https://jakarta.ee/specifications/cdi/4.0/[CDI 4.0] splits the CDI core into Lite and Full. Lite contains a subset of original features which are designed to work in more restricted environments. CDI Full contains everything that is in Lite plus all other features that were formerly in core CDI and are not in Lite.
@@ -86,4 +91,4 @@ A new `beans.xml` 3.0 schema file was added and the namespace of the
`xmlns:jakartaee="https://jakarta.ee/xml/ns/jakartaee"`.
-:numbered:
\ No newline at end of file
+:numbered:
From 3e607bb2c46899496bdedaafeef720b160c02053 Mon Sep 17 00:00:00 2001
From: Ladislav Thon
Date: Wed, 24 May 2023 14:33:15 +0200
Subject: [PATCH 022/113] Revert incorrect change in ambiguity resolution
We previously [1] changed the ambiguity resolution wording from
> The container eliminates all eligible beans that are not alternatives,
> except for producer methods and fields of beans that are alternatives.
to
> The container eliminates all eligible beans that are not alternatives
> selected for the application, except for producer methods and fields
> of beans that are alternatives.
At that time, we did _not_ add a rule to the CDI Full section that would
cover alternatives selected for the bean archive.
Note that for a bean to be _eligible_, it must be _available for injection_,
and an alternative is available for injection only if it is selected (for
application in CDI Lite; for application or for bean archive in CDI Full).
Alternative beans that are not selected are hence not even considered during
ambiguity resolution, so the ambiguity resolution description does not need
to mention them at all. This is why the previous description is correct.
Now, only eliminating beans that are not alternatives selected for application,
as the new text says, would mean that in CDI Full, beans that are alternatives
selected for bean archive would also be eliminated. That would be wrong.
Therefore, this change is incorrect. Of course, no implementation actually
made that change in behavior, and the TCK wasn't adjusted either.
There are 2 ways to fix this: revert to previous wording, or add extra wording
to the CDI Full section:
> The container eliminates all eligible beans that are not alternatives
> selected for the bean archive or selected for the application, except
> for producer methods and fields of beans that are alternatives.
This would be similar how ambiguous name resolution is specified.
This commit simply reverts to the previous wording, because that's easier,
even though it leads to slight inconsistency between ambiguous dependency
resolution and ambiguous name resolution. That inconsistency exists since
CDI 1.1, so is not an issue.
[1] https://github.com/jakartaee/cdi/commit/1840939753dee2af56cb9a8698ce4dc00c81e977
---
spec/src/main/asciidoc/core/injectionandresolution.asciidoc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/spec/src/main/asciidoc/core/injectionandresolution.asciidoc b/spec/src/main/asciidoc/core/injectionandresolution.asciidoc
index b737057e..25213d66 100644
--- a/spec/src/main/asciidoc/core/injectionandresolution.asciidoc
+++ b/spec/src/main/asciidoc/core/injectionandresolution.asciidoc
@@ -107,7 +107,7 @@ An _unsatisfied dependency_ exists at an injection point when no bean is eligibl
An _ambiguous dependency_ exists at an injection point when multiple beans are eligible for injection to the injection point.
When an ambiguous dependency exists, the container attempts to resolve the ambiguity.
-The container eliminates all eligible beans that are not alternatives selected for the application, except for producer methods and fields of beans that are alternatives.
+The container eliminates all eligible beans that are not alternatives, except for producer methods and fields of beans that are alternatives.
If:
* there is exactly one bean remaining, the container will select this bean, and the ambiguous dependency is called resolvable.
From 57b1c2c5ad1251f027ad700f2f0d0cae4655ab9c Mon Sep 17 00:00:00 2001
From: Ladislav Thon
Date: Wed, 24 May 2023 15:36:15 +0200
Subject: [PATCH 023/113] Fix the definition of availability for injection
We previously [1] changed the definition of _availability for injection_
from
> the bean is either not an alternative, or the module is a bean archive
> and the bean is a selected alternative of the bean archive, or the bean
> is a selected alternative of the application
to
> the bean is either not an alternative, or the module is a bean archive
> and the bean is a selected alternative for the application
in the CDI Lite section of the specification. The CDI Full section has
the original wording verbatim, so it does not have an issue.
The new wording is clearly wrong though, because the it mixes the 2nd and
3rd clause of the original sentence. What we should have done is to only
remove the 2nd clause:
> the bean is either not an alternative, or the bean is a selected
> alternative of the application
This commit does that.
[1] https://github.com/jakartaee/cdi/commit/693139b302b497df00461d40d4eb2c674bb052fa
---
spec/src/main/asciidoc/core/injectionandresolution.asciidoc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/spec/src/main/asciidoc/core/injectionandresolution.asciidoc b/spec/src/main/asciidoc/core/injectionandresolution.asciidoc
index 25213d66..e744e274 100644
--- a/spec/src/main/asciidoc/core/injectionandresolution.asciidoc
+++ b/spec/src/main/asciidoc/core/injectionandresolution.asciidoc
@@ -68,7 +68,7 @@ A bean is _available for injection_ in a certain module if:
* the bean is not an interceptor
* the bean is enabled,
-* the bean is either not an alternative, or the module is a bean archive and the bean is a selected alternative for the application, and
+* the bean is either not an alternative, or the bean is a selected alternative for the application, and
* the bean class is required to be accessible to classes in the module, according to the class accessibility requirements of the module architecture.
[[typesafe_resolution]]
From 9f6d5d0797c712655b095c6e75990bccea9b5bd3 Mon Sep 17 00:00:00 2001
From: Ladislav Thon
Date: Wed, 31 May 2023 14:24:38 +0200
Subject: [PATCH 024/113] Move the specification of
BeanManager.getInjectableReference() to CDI Full
We previously [1] moved the `getInjectableReference()` from the `BeanContainer`
interface to the `BeanManager` [2], but did not update the specification text
accordingly. Thus, the method is specified in the CDI Lite part of the spec,
but it in fact belongs to CDI Full. This commit moves the spec text around
to fix that.
Additionally, this commit removes the declaration of `resolveObserverMethods()`
from `BeanManager`, because that just overrides the same declaration that is
present on `BeanContainer`.
Finally, this commit moves the declaration of `getInjectableReference()` from
the end of the `BeanManager` source code to the beginning, for symmetry with
the `BeanContainer` declaration and to restore the previous layout.
[1] https://github.com/jakartaee/cdi/commit/520bad1989101bf4523e13e8e0c8f2d23cdc34b6
[2] https://github.com/jakartaee/cdi/issues/568
---
.../enterprise/inject/spi/BeanManager.java | 49 ++++++-------------
.../asciidoc/core/beanmanager_lite.asciidoc | 18 -------
spec/src/main/asciidoc/core/spi_full.asciidoc | 19 +++++--
3 files changed, 32 insertions(+), 54 deletions(-)
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/BeanManager.java b/api/src/main/java/jakarta/enterprise/inject/spi/BeanManager.java
index d70548ba..498bcc9b 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/BeanManager.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/BeanManager.java
@@ -92,6 +92,22 @@
*/
public interface BeanManager extends BeanContainer {
+ /**
+ *
+ * Obtains an injectable reference for a certain {@linkplain InjectionPoint injection point}.
+ *
+ *
+ * @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);
+
/**
* Returns the {@link PassivationCapable} bean with the given identifier.
*
@@ -121,24 +137,6 @@ public interface BeanManager extends BeanContainer {
*/
public void validate(InjectionPoint injectionPoint);
- /**
- * Return an ordered set of {@linkplain ObserverMethod observer methods} for an event.
- *
- * Note that when called during invocation of an {@link AfterBeanDiscovery} event observer,
- * this method will only return observers discovered by the container before the {@link AfterBeanDiscovery} event is fired.
- *
- * @param the type of the event
- * @param event the event object
- * @param qualifiers the event qualifiers
- * @return the resulting set of {@linkplain ObserverMethod observer methods}
- * @throws IllegalArgumentException if the runtime type of the event object contains a type variable
- * @throws IllegalArgumentException if two instances of the same non repeating qualifier type are given
- * @throws IllegalArgumentException if an instance of an annotation that is not a qualifier type is given
- * @throws IllegalStateException if called during application initialization, before the {@link AfterBeanDiscovery}
- * event is fired.
- */
- public Set> resolveObserverMethods(T event, Annotation... qualifiers);
-
/**
* Return an ordered list of {@linkplain Decorator decorators} for a set of bean types and a set of qualifiers and which are
* enabled in the module or library containing the class into which the BeanManager was injected or the Java EE
@@ -423,19 +421,4 @@ public Bean createBean(BeanAttributes attributes, Class beanClass,
*/
InterceptionFactory createInterceptionFactory(CreationalContext ctx, Class clazz);
- /**
- *
- * Obtains an injectable reference for a certain {@linkplain InjectionPoint injection point}.
- *
- *
- * @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);
}
diff --git a/spec/src/main/asciidoc/core/beanmanager_lite.asciidoc b/spec/src/main/asciidoc/core/beanmanager_lite.asciidoc
index 07ecc51c..532efd19 100644
--- a/spec/src/main/asciidoc/core/beanmanager_lite.asciidoc
+++ b/spec/src/main/asciidoc/core/beanmanager_lite.asciidoc
@@ -90,24 +90,6 @@ The third parameter is an instance of `CreationalContext` that may be used to de
If the given type is not a bean type of the given bean, an `IllegalArgumentException` is thrown.
-[[bm_obtain_injectable_reference]]
-
-==== Obtaining an injectable reference
-
-The method `BeanContainer.getInjectableReference()` returns an injectable reference for a given injection point, as defined in <>.
-
-[source, java]
-----
-public Object getInjectableReference(InjectionPoint ij, CreationalContext> ctx);
-----
-
-The first parameter represents the target injection point.
-The second parameter is an instance of `CreationalContext` that may be used to destroy any object with scope `@Dependent` that is created.
-
-If typesafe resolution results in an unsatisfied dependency, the container must throw an `UnsatisfiedResolutionException`. If typesafe resolution results in an unresolvable ambiguous dependency, the container must throw an `AmbiguousResolutionException`.
-
-Implementations of `Bean` usually maintain a reference to an instance of `BeanContainer`. When the `Bean` implementation performs dependency injection, it must obtain the contextual instances to inject by calling `BeanContainer.getInjectableReference()`, passing an instance of `InjectionPoint` that represents the injection point and the instance of `CreationalContext` that was passed to `Bean.create()`.
-
[[bm_obtain_creationalcontext]]
==== Obtaining a `CreationalContext`
diff --git a/spec/src/main/asciidoc/core/spi_full.asciidoc b/spec/src/main/asciidoc/core/spi_full.asciidoc
index d58c81ca..6d5e04b2 100644
--- a/spec/src/main/asciidoc/core/spi_full.asciidoc
+++ b/spec/src/main/asciidoc/core/spi_full.asciidoc
@@ -256,14 +256,27 @@ A portable extension or other object may obtain a reference to the current conta
`CDI.getBeanManager()` and `CDI.getBeanContainer()` may be called at any time after the container fires the `BeforeBeanDiscovery` container lifecycle event until the container fires the `BeforeShutdown` container lifecycle event.
If methods on `CDI` are called at any other time, non-portable behavior results.
-[[bm_obtain_injectable_reference_full]]
+[[bm_obtain_injectable_reference]]
-==== Obtaining an injectable reference in {cdi_full}
+==== Obtaining an injectable reference
-In addition to rules defined in <>, the following rules apply.
+The method `BeanManager.getInjectableReference()` returns an injectable reference for a given injection point, as defined in <>.
+
+[source, java]
+----
+public Object getInjectableReference(InjectionPoint ij, CreationalContext> ctx);
+----
+
+The first parameter represents the target injection point.
+The second parameter is an instance of `CreationalContext` that may be used to destroy any object with scope `@Dependent` that is created.
If the `InjectionPoint` represents a decorator delegate injection point, `getInjectableReference()` returns a delegate, as defined in <>.
+If typesafe resolution results in an unsatisfied dependency, the container must throw an `UnsatisfiedResolutionException`. If typesafe resolution results in an unresolvable ambiguous dependency, the container must throw an `AmbiguousResolutionException`.
+
+Implementations of `Bean` usually maintain a reference to an instance of `BeanManager`. When the `Bean` implementation performs dependency injection, it must obtain the contextual instances to inject by calling `BeanManager.getInjectableReference()`, passing an instance of `InjectionPoint` that represents the injection point and the instance of `CreationalContext` that was passed to `Bean.create()`.
+
+
[[bm_obtain_unmanaged_instance]]
==== Obtaining non-contextual instance
From 37afd0e99f51ed0261ebfdb094575a6c45ef720e Mon Sep 17 00:00:00 2001
From: Ladislav Thon
Date: Tue, 27 Jun 2023 16:55:21 +0200
Subject: [PATCH 025/113] Add specification text for
BeanContainer.getContexts()
---
spec/src/main/asciidoc/core/beanmanager_lite.asciidoc | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/spec/src/main/asciidoc/core/beanmanager_lite.asciidoc b/spec/src/main/asciidoc/core/beanmanager_lite.asciidoc
index 532efd19..5978c45a 100644
--- a/spec/src/main/asciidoc/core/beanmanager_lite.asciidoc
+++ b/spec/src/main/asciidoc/core/beanmanager_lite.asciidoc
@@ -233,6 +233,17 @@ The method `BeanContainer.getContext()` retrieves an active context object assoc
public Context getContext(Class extends Annotation> scopeType);
----
+[[bm_obtain_contexts]]
+
+==== Obtaining ``Context``s for a scope
+
+The method `BeanContainer.getContexts()` retrieves all context objects, active and inactive, associated with the given scope, as defined in <>.
+
+[source, java]
+----
+public Collection getContexts(Class extends Annotation> scopeType);
+----
+
[[bm_obtain_instance]]
==== Obtain an `Instance`
From bbfd0c403f2224bd81240d0654670d7ad74549a2 Mon Sep 17 00:00:00 2001
From: Andrew Rouse
Date: Thu, 10 Aug 2023 17:28:12 +0100
Subject: [PATCH 026/113] Fix Javadoc for createInstance validity
The spec and TCK assert that BeanContainer.createInstance() must not be
called before the AfterDeploymentValidation event is fired.
Correct some Javadoc which was inconsistent.
Signed-off-by: Andrew Rouse
---
.../java/jakarta/enterprise/inject/spi/BeanContainer.java | 4 ----
.../main/java/jakarta/enterprise/inject/spi/BeanManager.java | 2 +-
2 files changed, 1 insertion(+), 5 deletions(-)
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 1d608b48..cf6b0bdc 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/BeanContainer.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/BeanContainer.java
@@ -241,10 +241,6 @@ public interface BeanContainer {
* or, in the Jakarta EE environment, the Jakarta EE component from whose JNDI environment namespace the
* BeanContainer was obtained, according to the rules of typesafe resolution.
*
- * Note that when called during invocation of an {@link AfterBeanDiscovery} event observer,
- * the Instance returned by this method will only give access to instances of beans discovered by the container
- * before the {@link AfterBeanDiscovery} event is fired.
- *
* Instances of dependent scoped beans obtained with this Instance must be explicitly destroyed by calling {@link Instance#destroy(Object)}
*
* If no qualifier is passed to {@link Instance#select} method, the @Default qualifier is assumed.
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/BeanManager.java b/api/src/main/java/jakarta/enterprise/inject/spi/BeanManager.java
index 498bcc9b..47abcabc 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/BeanManager.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/BeanManager.java
@@ -71,12 +71,12 @@
*
From 8ead70bdd135d277e277dfffc086b58dd92a1de3 Mon Sep 17 00:00:00 2001
From: Ladislav Thon
Date: Wed, 30 Aug 2023 14:33:26 +0200
Subject: [PATCH 027/113] Fix guards against repeated external sets of SPI
implementations
We previously [1] added code to guard against repeated calls to these SPIs:
- `BuildServicesResolver.setBuildServices()`
- `CDI.setCDIProvider()`
The guards are unfortunately incorrect. This commit fixes them.
[1] https://github.com/jakartaee/cdi/commit/82ec5d71872212364a321cd3700d0ecadf9162d2
---
.../inject/build/compatible/spi/BuildServicesResolver.java | 2 +-
api/src/main/java/jakarta/enterprise/inject/spi/CDI.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BuildServicesResolver.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BuildServicesResolver.java
index 702bf860..93380024 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BuildServicesResolver.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BuildServicesResolver.java
@@ -82,7 +82,7 @@ public static void setBuildServices(BuildServices instance) {
if (instance == null) {
throw new IllegalArgumentException("BuildServices instance must not be null");
}
- if (configuredBuildServices != null) {
+ if (configuredBuildServices == null) {
configuredBuildServices = instance;
} else {
throw new IllegalStateException("BuildServices cannot be set repeatedly. Existing BuildServices are " + configuredBuildServices);
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/CDI.java b/api/src/main/java/jakarta/enterprise/inject/spi/CDI.java
index 7e793500..1182a7ef 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/CDI.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/CDI.java
@@ -123,7 +123,7 @@ public static void setCDIProvider(CDIProvider provider) {
if (provider == null) {
throw new IllegalArgumentException("CDIProvider must not be null");
}
- if (configuredProvider != null) {
+ if (configuredProvider == null) {
providerSetManually = true;
configuredProvider = provider;
} else {
From 264a1a3397c5e9eb48b210694b82f24260819b59 Mon Sep 17 00:00:00 2001
From: Ladislav Thon
Date: Mon, 2 Oct 2023 13:24:16 +0200
Subject: [PATCH 028/113] Clarify the relationship between CDI Lite and CDI
Full specifications
---
spec/src/main/asciidoc/core/definition_full.asciidoc | 3 +++
1 file changed, 3 insertions(+)
diff --git a/spec/src/main/asciidoc/core/definition_full.asciidoc b/spec/src/main/asciidoc/core/definition_full.asciidoc
index 98dcb010..9624fcda 100644
--- a/spec/src/main/asciidoc/core/definition_full.asciidoc
+++ b/spec/src/main/asciidoc/core/definition_full.asciidoc
@@ -2,6 +2,9 @@
--
{cdi_full} contains all the functionality defined in {cdi_lite} and adds some additional features such as specialization, decorators, session scope or conversation scope.
Some of these concepts were briefly mentioned in the previous {cdi_lite} chapter and this section of specification defines them in depth.
+
+All rules from the {cdi_lite} specification apply to {cdi_full}, unless the {cdi_full} specification says otherwise.
+Most sections of the {cdi_full} specification add new rules on top of the {cdi_lite} specification, but some override the corresponding section of the {cdi_lite} specification and provide a replacing set of rules.
--
[[scopes_full]]
From bf4dbf1cdd05bd5af52b3bda6ea54a6c2b1ca09a Mon Sep 17 00:00:00 2001
From: Ladislav Thon
Date: Tue, 3 Oct 2023 10:51:40 +0200
Subject: [PATCH 029/113] Specify behavior for sealed types
Sealed types are valid bean types, but they are unproxyable.
This commit only makes explicit what already implicitly follows from
the existing CDI specification and updates in the Java / JVM specifications.
---
spec/src/main/asciidoc/core/definition.asciidoc | 2 +-
spec/src/main/asciidoc/core/implementation.asciidoc | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/spec/src/main/asciidoc/core/definition.asciidoc b/spec/src/main/asciidoc/core/definition.asciidoc
index 108028cd..1f1fe828 100644
--- a/spec/src/main/asciidoc/core/definition.asciidoc
+++ b/spec/src/main/asciidoc/core/definition.asciidoc
@@ -81,7 +81,7 @@ The bean types of a bean are used by the rules of typesafe resolution defined in
Almost any Java type may be a bean type of a bean:
-* A bean type may be an interface, a concrete class or an abstract class, and may be declared final or have final methods.
+* A bean type may be an interface, a concrete class or an abstract class, may be declared sealed or non-sealed or final, and may have final methods.
* A bean type may be a parameterized type with actual type parameters and type variables.
* A bean type may be an array type.
Two array types are considered identical only if the element type is identical.
diff --git a/spec/src/main/asciidoc/core/implementation.asciidoc b/spec/src/main/asciidoc/core/implementation.asciidoc
index 4b41305b..54859419 100644
--- a/spec/src/main/asciidoc/core/implementation.asciidoc
+++ b/spec/src/main/asciidoc/core/implementation.asciidoc
@@ -662,6 +662,7 @@ Certain legal bean types cannot be proxied by the container:
* classes which don't have a non-private constructor with no parameters,
* classes which are declared final,
* classes which have non-static, final methods with public, protected or default visibility,
+* sealed classes and sealed interfaces,
* primitive types,
* and array types.
From 15e84a07bf573ebe4ef077a667fa56dcd7ec5541 Mon Sep 17 00:00:00 2001
From: Ladislav Thon
Date: Thu, 10 Nov 2022 15:36:41 +0100
Subject: [PATCH 030/113] Initial proposal for method invokers: introduce core
concepts
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
_`Invoker`_ is an indirect way of invoking a bean method. It is a simple
functional interface:
```java
interface Invoker {
R invoke(T instance, Object[] arguments);
}
```
Invokers are built using an _`InvokerBuilder`_. They must be thread-safe,
so frameworks can build an invoker for each relevant method once and then
reuse it to invoke that method whenever necessary.
An invoker may be built for a method that:
1. is not `private`;
2. is not a constructor;
3. is declared on a bean class of a managed bean (class-based bean),
with the exception of interceptors and decorators, or inherited
from its supertypes.
If an invocation of a method is intercepted, an equivalent invocation
through an invoker is also intercepted.
Portable extensions may obtain an `InvokerBuilder` in an observer
of the `ProcessManagedBean` type. The `InvokerBuilder` in this case
produces `Invoker` objects directly.
Build compatible extensions may obtain an `InvokerBuilder` during
`@Registration` from the `BeanInfo` object. The `InvokerBuilder` in
this case produces `InvokerInfo` objects. `InvokerInfo` is an opaque
token that can only be used to materialize an `Invoker` in synthetic
components.
---
.../inject/build/compatible/spi/BeanInfo.java | 20 +++
.../build/compatible/spi/InvokerInfo.java | 25 ++++
.../build/compatible/spi/Parameters.java | 13 +-
.../compatible/spi/SyntheticBeanBuilder.java | 30 ++++
.../spi/SyntheticObserverBuilder.java | 28 ++++
.../inject/spi/ProcessManagedBean.java | 16 +++
.../jakarta/enterprise/invoke/Invoker.java | 128 ++++++++++++++++++
.../enterprise/invoke/InvokerBuilder.java | 28 ++++
api/src/main/java/module-info.java | 1 +
9 files changed, 285 insertions(+), 4 deletions(-)
create mode 100644 api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/InvokerInfo.java
create mode 100644 api/src/main/java/jakarta/enterprise/invoke/Invoker.java
create mode 100644 api/src/main/java/jakarta/enterprise/invoke/InvokerBuilder.java
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BeanInfo.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BeanInfo.java
index 2aeb0a49..df54baab 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BeanInfo.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BeanInfo.java
@@ -10,6 +10,7 @@
package jakarta.enterprise.inject.build.compatible.spi;
+import jakarta.enterprise.invoke.InvokerBuilder;
import jakarta.enterprise.lang.model.AnnotationInfo;
import jakarta.enterprise.lang.model.declarations.ClassInfo;
import jakarta.enterprise.lang.model.declarations.FieldInfo;
@@ -162,6 +163,25 @@ public interface BeanInfo {
*/
Collection injectionPoints();
+ /**
+ * Returns a new {@link InvokerBuilder} for given method. The builder eventually produces
+ * an opaque representation of the invoker for the given method.
+ *
+ * The {@code method} must be declared on the bean class or inherited from a supertype
+ * of the bean class of this bean, otherwise an exception is thrown.
+ *
+ * If an invoker may not be obtained for given {@code method} as described
+ * in {@link jakarta.enterprise.invoke.Invoker Invoker}, an exception is thrown.
+ *
+ * If this method is called outside the {@code @Registration} phase, an exception is thrown.
+ *
+ * @param method method of this bean, must not be {@code null}
+ * @return the invoker builder, never {@code null}
+ * @since 4.1
+ */
+ // TODO we may want to introduce another entrypoint for this operation
+ InvokerBuilder createInvoker(MethodInfo method);
+
// ---
/**
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/InvokerInfo.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/InvokerInfo.java
new file mode 100644
index 00000000..d0038c4a
--- /dev/null
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/InvokerInfo.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2022 Red Hat and others
+ *
+ * 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 jakarta.enterprise.invoke.Invoker;
+import jakarta.enterprise.lang.model.declarations.MethodInfo;
+
+/**
+ * Opaque token that stands in for an invoker registered using {@link BeanInfo#createInvoker(MethodInfo)}.
+ * It can only be used to materialize an {@link Invoker} in a synthetic component; see
+ * {@link SyntheticBeanBuilder#withParam(String, InvokerInfo) SyntheticBeanBuilder.withParam()} or
+ * {@link SyntheticObserverBuilder#withParam(String, InvokerInfo) SyntheticObserverBuilder.withParam()}.
+ *
+ * @since 4.1
+ */
+public interface InvokerInfo {
+}
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/Parameters.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/Parameters.java
index 54ad368d..96b28dc7 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/Parameters.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/Parameters.java
@@ -10,6 +10,8 @@
package jakarta.enterprise.inject.build.compatible.spi;
+import jakarta.enterprise.invoke.Invoker;
+
/**
* A {@code String}-keyed parameter map. The parameter mappings are defined
* by a synthetic component builder. The CDI container passes the parameter map
@@ -40,13 +42,16 @@
*
* Annotation-typed parameters are available as instances of the annotation type,
* even if an instance of {@code AnnotationInfo} was passed to the builder.
+ *
+ * Invoker-typed parameters are available as instances of {@link Invoker}, even though
+ * an instance of {@code InvokerInfo} was passed to the builder.
*/
public interface Parameters {
/**
* Returns the value of a parameter with given {@code key}. The value is expected to be of given {@code type}.
*
- * @param key the parameter key; must not be {@code null}
- * @param type the parameter type; must not be {@code null}
+ * @param key the parameter key, must not be {@code null}
+ * @param type the parameter type, must not be {@code null}
* @param the parameter type
* @return the parameter value, or {@code null} if parameter with given {@code key} does not exist
* @throws ClassCastException if the parameter exists, but is of a different type
@@ -57,8 +62,8 @@ public interface Parameters {
* Returns the value of a parameter with given {@code key}. The value is expected to be of given {@code type}.
* If the parameter does not exist, returns {@code defaultValue}.
*
- * @param key the parameter key; must not be {@code null}
- * @param type the parameter type; must not be {@code null}
+ * @param key the parameter key, must not be {@code null}
+ * @param type the parameter type, must not be {@code null}
* @param defaultValue the value to return if parameter with given {@code key} does not exist
* @param the parameter type
* @return the parameter value, or {@code defaultValue} if parameter with given {@code key} does not exist
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticBeanBuilder.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticBeanBuilder.java
index 2f2b8f1e..8afb2c94 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticBeanBuilder.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticBeanBuilder.java
@@ -405,6 +405,36 @@ public interface SyntheticBeanBuilder {
*/
SyntheticBeanBuilder withParam(String key, Annotation[] value);
+ /**
+ * Adds an invoker-valued parameter to the parameter map. The parameter map is passed
+ * to the {@linkplain SyntheticBeanCreator creation} and {@linkplain SyntheticBeanDisposer destruction}
+ * functions when a bean instance is created/destroyed.
+ *
+ * When looked up from the parameter map in the creation/destruction function, the value will be
+ * an instance of {@link jakarta.enterprise.invoke.Invoker Invoker}, not an {@code InvokerInfo}.
+ *
+ * @param key the parameter key, must not be {@code null}
+ * @param value the parameter value
+ * @return this {@code SyntheticBeanBuilder}
+ * @since 4.1
+ */
+ SyntheticBeanBuilder withParam(String key, InvokerInfo value);
+
+ /**
+ * Adds an invoker array-valued parameter to the parameter map. The parameter map is passed
+ * to the {@linkplain SyntheticBeanCreator creation} and {@linkplain SyntheticBeanDisposer destruction}
+ * functions when a bean instance is created/destroyed.
+ *
+ * When looked up from the parameter map in the creation/destruction function, the values will be
+ * instances of {@link jakarta.enterprise.invoke.Invoker Invoker}, not {@code InvokerInfo}.
+ *
+ * @param key the parameter key, must not be {@code null}
+ * @param value the parameter value
+ * @return this {@code SyntheticBeanBuilder}
+ * @since 4.1
+ */
+ SyntheticBeanBuilder withParam(String key, InvokerInfo[] value);
+
/**
* Sets the class of the synthetic bean {@linkplain SyntheticBeanCreator creation} function.
* CDI container will create an instance of the creation function every time when it needs
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticObserverBuilder.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticObserverBuilder.java
index 25fffcb7..4e2b102c 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticObserverBuilder.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticObserverBuilder.java
@@ -334,6 +334,34 @@ public interface SyntheticObserverBuilder {
*/
SyntheticObserverBuilder withParam(String key, Annotation[] value);
+ /**
+ * Adds an invoker-valued parameter to the parameter map. The parameter map is passed
+ * to the {@linkplain SyntheticObserver event notification} function when the event is fired.
+ *
+ * When looked up from the parameter map in the event notification function, the value will be
+ * an instance of {@link jakarta.enterprise.invoke.Invoker Invoker}, not an {@code InvokerInfo}.
+ *
+ * @param key the parameter key, must not be {@code null}
+ * @param value the parameter value
+ * @return this {@code SyntheticBeanBuilder}
+ * @since 4.1
+ */
+ SyntheticObserverBuilder withParam(String key, InvokerInfo value);
+
+ /**
+ * Adds an invoker array-valued parameter to the parameter map. The parameter map is passed
+ * to the {@linkplain SyntheticObserver event notification} function when the event is fired.
+ *
+ * When looked up from the parameter map in the event notification function, the values will be
+ * instances of {@link jakarta.enterprise.invoke.Invoker Invoker}, not {@code InvokerInfo}.
+ *
+ * @param key the parameter key, must not be {@code null}
+ * @param value the parameter value
+ * @return this {@code SyntheticBeanBuilder}
+ * @since 4.1
+ */
+ SyntheticObserverBuilder withParam(String key, InvokerInfo[] value);
+
/**
* Sets the class of the synthetic observer {@linkplain SyntheticObserver event notification} function.
* CDI container will create an instance of the event notification function every time when it needs
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessManagedBean.java b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessManagedBean.java
index f2cd0b21..9b10bd86 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessManagedBean.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessManagedBean.java
@@ -15,6 +15,9 @@
*/
package jakarta.enterprise.inject.spi;
+import jakarta.enterprise.invoke.Invoker;
+import jakarta.enterprise.invoke.InvokerBuilder;
+
/**
*
* The container fires an event of this type for each enabled managed bean, before registering the
@@ -38,4 +41,17 @@ public interface ProcessManagedBean extends ProcessBean {
* @throws IllegalStateException if called outside of the observer method invocation
*/
public AnnotatedType getAnnotatedBeanClass();
+
+ /**
+ * Returns a new {@link InvokerBuilder} for given method. The builder eventually produces an invoker
+ * for the given method.
+ *
+ * The {@code method} must be declared on the bean class or inherited from a supertype
+ * of the bean class of the bean being registered, otherwise an exception is thrown.
+ *
+ * @param method method of the bean being registered, must not be {@code null}
+ * @return the invoker builder, never {@code null}
+ * @since 4.1
+ */
+ public InvokerBuilder> createInvoker(AnnotatedMethod super X> method);
}
diff --git a/api/src/main/java/jakarta/enterprise/invoke/Invoker.java b/api/src/main/java/jakarta/enterprise/invoke/Invoker.java
new file mode 100644
index 00000000..2f06d6f3
--- /dev/null
+++ b/api/src/main/java/jakarta/enterprise/invoke/Invoker.java
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2022 Red Hat and others
+ *
+ * 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.invoke;
+
+/**
+ * Allows indirectly invoking a method that belongs to a managed bean (the target method).
+ * To invoke the method, the caller must provide all the arguments that the target method accepts,
+ * as well as the instance on which the target method is to be invoked, if it is not {@code static}.
+ *
+ * Whenever a direct invocation of a method is a business method invocation, an indirect invocation
+ * of that method through an invoker is also a business method invocation.
+ *
+ * Invoker implementations must be thread-safe. It is possible to use a single invoker instance
+ * to perform multiple independent invocations of the target method, possibly on different instances
+ * and with different arguments.
+ *
+ *
Obtaining an invoker
+ *
+ * The CDI container allows {@linkplain InvokerBuilder building} an invoker for non-private
+ * methods declared on a managed bean class or inherited from a supertype. Attempting to build
+ * an invoker for a private method or a constructor of a managed bean class leads to a deployment
+ * problem. Attempting to build an invoker for a method of a class that is not a managed bean class
+ * or that is an interceptor or decorator class leads to a deployment problem.
+ *
+ * Multiple managed beans may inherit a method from a common supertype. In that case, each bean
+ * conceptually has its own method and an invoker obtained for one bean may not be used to invoke
+ * the method on the other bean.
+ *
+ * Using the {@link InvokerBuilder} is the only way to obtain an invoker. An {@code InvokerBuilder}
+ * can only be obtained in CDI portable extensions and build compatible extensions.
+ *
+ *
Example
+ *
+ * To illustrate how invokers work, let's take a look at an example. Say that the following bean
+ * exists and has a method that you want to invoke indirectly:
+ *
+ *
+ *
+ * When you obtain an {@code InvokerBuilder} for the {@code hello()} method, you can
+ * immediately build a direct invoker. In a portable extension, this results in an invoker:
+ *
+ *
+ *
+ * To call the {@code hello()} method through this invoker, call
+ * {@code invoker.invoke(myService, new Object[] {"world"})}.
+ * The return value is {@code "Hello world!"}.
+ *
+ * An implementation of the direct invoker above is equivalent to the following class:
+ *
+ *
+ *
+ * @param type of the target instance
+ * @param return type of the method
+ * @since 4.1
+ * @see #invoke(Object, Object[])
+ */
+public interface Invoker {
+ /**
+ * Invokes the target method of this invoker on given {@code instance}, passing given
+ * {@code arguments}. If the target method is {@code static}, the {@code instance} is ignored;
+ * by convention, it should be {@code null}. If the target method returns normally, this
+ * method returns its return value, unless the target method is declared {@code void},
+ * in which case this method returns {@code null}. If the target method throws an exception,
+ * this method rethrows it directly.
+ *
+ * If some parameter of the target method declares a primitive type, the corresponding element of
+ * the {@code arguments} array must be of the corresponding wrapper type. No type conversions are
+ * performed, so if the parameter is declared {@code int}, the argument must be an {@code Integer}
+ * and may not be {@code Short} or {@code Long}. If the argument is {@code null}, the default value
+ * of the primitive type is used. Note that this does not apply to arrays of primitive types;
+ * if a parameter is declared {@code int[]}, the argument must be {@code int[]} and may not be
+ * {@code Integer[]}.
+ *
+ * If the target method is not {@code static} and {@code instance} is {@code null},
+ * a {@link NullPointerException} is thrown. If the target method is not {@code static} and
+ * the {@code instance} is not assignable to the class of the bean to which the method belongs,
+ * a {@link ClassCastException} is thrown.
+ *
+ * If the target method declares no parameter, {@code arguments} are ignored. If the target method
+ * declares any parameter and {@code arguments} is {@code null}, {@link NullPointerException} is
+ * thrown. If the {@code arguments} array has fewer elements than the number of parameters of
+ * the target method, {@link ArrayIndexOutOfBoundsException} is thrown. If the {@code arguments}
+ * array has more elements than the number of parameters of the target method, the excess elements
+ * are ignored. If some of the {@code arguments} is not assignable to the declared type of
+ * the corresponding parameter of the target method, {@link ClassCastException} is thrown.
+ *
+ * TODO the previous 2 paragraphs refer to "assignability", which needs to be defined somewhere!
+ *
+ * @param instance the instance on which the target method is to be invoked, may only be {@code null}
+ * if the method is {@code static}
+ * @param arguments arguments to be supplied to the target method, may only be {@code null}
+ * if the method declares no parameter
+ * @return return value of the target method, or {@code null} if the method is declared {@code void}
+ */
+ R invoke(T instance, Object[] arguments); // TODO throws Exception ?
+}
diff --git a/api/src/main/java/jakarta/enterprise/invoke/InvokerBuilder.java b/api/src/main/java/jakarta/enterprise/invoke/InvokerBuilder.java
new file mode 100644
index 00000000..f8df0e84
--- /dev/null
+++ b/api/src/main/java/jakarta/enterprise/invoke/InvokerBuilder.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2022 Red Hat and others
+ *
+ * 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.invoke;
+
+/**
+ * Builder of {@link Invoker}s.
+ *
+ * @param type of outcome of this builder; always represents an {@code Invoker},
+ * but does not necessarily have to be an {@code Invoker} instance directly
+ * @since 4.1
+ */
+public interface InvokerBuilder {
+ /**
+ * Returns the built {@link Invoker} or some represention of it. Implementations are allowed
+ * but not required to reuse already built invokers for the same target method.
+ *
+ * @return the built invoker
+ */
+ T build();
+}
diff --git a/api/src/main/java/module-info.java b/api/src/main/java/module-info.java
index 1aa23218..4239d4d3 100644
--- a/api/src/main/java/module-info.java
+++ b/api/src/main/java/module-info.java
@@ -10,6 +10,7 @@
exports jakarta.enterprise.inject.se;
exports jakarta.enterprise.inject.spi;
exports jakarta.enterprise.inject.spi.configurator;
+ exports jakarta.enterprise.invoke;
exports jakarta.enterprise.util;
requires transitive jakarta.annotation;
From e613cd3511c958d78737d869da0909f7acfcbdac Mon Sep 17 00:00:00 2001
From: Ladislav Thon
Date: Tue, 18 Jul 2023 15:51:39 +0200
Subject: [PATCH 031/113] Initial proposal for method invokers: invoker builder
features
This commit introduces actual interesting features to the `InvokerBuilder`:
- automatic lookup of the target instance and arguments
- transformation of the target instance and arguments before invocation
- transformation of the return value and thrown exception after invocation
- wrapping the invoker into a custom piece of code for maximum flexibility
---
.../jakarta/enterprise/invoke/Invoker.java | 4 +
.../enterprise/invoke/InvokerBuilder.java | 345 +++++++++++++++++-
2 files changed, 347 insertions(+), 2 deletions(-)
diff --git a/api/src/main/java/jakarta/enterprise/invoke/Invoker.java b/api/src/main/java/jakarta/enterprise/invoke/Invoker.java
index 2f06d6f3..ede8faa8 100644
--- a/api/src/main/java/jakarta/enterprise/invoke/Invoker.java
+++ b/api/src/main/java/jakarta/enterprise/invoke/Invoker.java
@@ -118,6 +118,10 @@ public interface Invoker {
*
* TODO the previous 2 paragraphs refer to "assignability", which needs to be defined somewhere!
*
+ * TODO when the `InvokerBuilder` applies transformations, some of the requirements above
+ * are no longer strictly necessary, should reflect that in this text somehow (it is already
+ * mentioned in `InvokerBuilder`, but that likely isn't enough)
+ *
* @param instance the instance on which the target method is to be invoked, may only be {@code null}
* if the method is {@code static}
* @param arguments arguments to be supplied to the target method, may only be {@code null}
diff --git a/api/src/main/java/jakarta/enterprise/invoke/InvokerBuilder.java b/api/src/main/java/jakarta/enterprise/invoke/InvokerBuilder.java
index f8df0e84..97342ef7 100644
--- a/api/src/main/java/jakarta/enterprise/invoke/InvokerBuilder.java
+++ b/api/src/main/java/jakarta/enterprise/invoke/InvokerBuilder.java
@@ -11,16 +11,357 @@
package jakarta.enterprise.invoke;
/**
- * Builder of {@link Invoker}s.
+ * Builder of {@link Invoker}s that allows configuring input lookups, input and output
+ * transformations, and invoker wrapping. The method for which the invoker is built is
+ * called the target method. If a lookup is configured, the corresponding input
+ * of the invoker is ignored and an instance is looked up from the CDI container before
+ * the target method is invoked. If a transformation is configured, the corresponding input
+ * or output of the invoker is modified in certain way before or after the target method
+ * is invoked. If a wrapper is configured, the invoker is passed to custom code for getting
+ * invoked. As a result, the built {@code Invoker} instance may have more complex behavior
+ * than just directly calling the target method.
+ *
+ * Transformations and wrapping are expressed by ordinary methods that must have
+ * a pre-defined signature, as described below. Such methods are called
+ * transformers and wrappers.
+ *
+ * Invokers may only be built during deployment. It is not possible to build new invokers
+ * at application runtime.
+ *
+ *
Example
+ *
+ * Before describing in detail how lookups, transformers and wrappers work, let's take
+ * a look at an example. Say we have the following bean with a method:
+ *
+ *
+ *
+ * And we want to build an invoker that looks up {@code MyService} from the CDI container,
+ * always passes the argument to {@code hello()} as all upper-case, and repeats the return
+ * value twice. To transform the argument, we can use the zero-parameter method
+ * {@code String.toUpperCase()}, and to transform the return value, we write a transformer
+ * as a simple {@code static} method:
+ *
+ *
+ *
+ * Then, assuming we have obtained the {@code InvokerBuilder} for {@code MyService.hello()},
+ * we can set up the lookup and transformations and build an invoker like so:
+ *
+ *
+ *
+ * The caller of this invoker may pass {@code null} as the target instance, because
+ * the invoker will lookup the target instance on its own. Therefore, calling
+ * {@code invoker.invoke(null, new Object[] {"world"})} will return
+ * {@code "Hello WORLD! Hello WORLD!"}.
+ *
+ *
General requirements
+ *
+ * To refer to a transformer or a wrapper, all methods in this builder accept:
+ * 1. the {@code Class} that that declares the method, and 2. the {@code String} name
+ * of the method.
+ *
+ * Transformers may be {@code static}, in which case they must be declared directly
+ * on the given class, or they may be instance methods, in which case they may be declared
+ * on the given class or inherited from any of its supertypes.
+ *
+ * It is possible to register only one transformer of each kind, or for each argument
+ * position in case of argument transformers. Attempting to register a second transformer
+ * of the same kind, or for the same argument position, leads to an exception.
+ *
+ * Wrappers must be {@code static} and must be declared directly on the given class.
+ * It is possible to register only one wrapper. Attempting to register a second wrapper
+ * leads to an exception.
+ *
+ * It is a deployment problem if no method with given name and valid signature is found,
+ * or if multiple methods with given name and different valid signatures are found. It is
+ * a deployment problem if a registered transformer or wrapper is not {@code public}.
+ *
+ * Transformers and wrappers may declare the {@code throws} clause. The declared exception
+ * types are ignored when searching for the method.
+ *
+ * For the purpose of the specification of transformers and wrappers below, the term
+ * any-type is recursively defined as: the {@code java.lang.Object} class type,
+ * or a type variable that has no bound, or a type variable whose first bound is
+ * any-type.
+ *
+ *
Input lookups
+ *
+ * For the target instance and for each argument, it is possible to specify that the value
+ * passed to {@code Invoker.invoke()} should be ignored and a value should be looked up
+ * from the CDI container instead.
+ *
+ * For the target instance, a CDI lookup is performed with the required type equal to the bean
+ * class of the bean to which the target method belongs, and required qualifiers equal to the set
+ * of all qualifier annotations present on the bean class of the bean to which the target method
+ * belongs. When the target method is {@code static}, the target instance lookup is skipped.
+ *
+ * For an argument, a CDI lookup is performed with the required type equal to the type of
+ * the corresponding parameter of the target method, and required qualifiers equal to the set
+ * of all qualifier annotations present on the corresponding parameter of the target method.
+ *
+ * Implementations are required to resolve all lookups during deployment. It is a deployment
+ * problem if the lookup ends up unresolved or ambiguous.
+ *
+ * If the looked up bean is {@code @Dependent}, it is guaranteed that the instance will be
+ * destroyed after the target method is invoked but before the the invoker returns. The order
+ * in which the looked up {@code @Dependent} beans are destroyed is not specified.
+ *
+ * The order in which input lookups are performed in not specified and must not be relied upon.
+ *
+ *
Input transformations
+ *
+ * The target method has 2 kinds of inputs: the target instance (unless the target method is
+ * {@code static}, in which case the target instance is ignored and should be {@code null}
+ * by convention) and arguments. These inputs correspond to the parameters of
+ * {@link Invoker#invoke(Object, Object[]) Invoker.invoke()}.
+ *
+ * Each input can be transformed by a transformer that has one of the following signatures,
+ * where {@code X} and {@code Y} are types:
+ *
+ *
+ *
{@code static X transform(Y value)}
+ *
{@code static X transform(Y value, Consumer cleanup)}
+ *
{@code X transform()} – in this case, {@code Y} is the type of the class that
+ * declares the transformer
+ *
+ *
+ * An input transformer must produce a type that can be consumed by the target method.
+ * Specifically: when {@code X} is any-type, it is not type checked during deployment.
+ * Otherwise, it is a deployment problem if {@code X} is not assignable to the corresponding type
+ * in the declaration of the target method (that is the bean class in case of target instance
+ * transformers, or the corresponding parameter type in case of argument transformers). {@code Y}
+ * is not type checked during deployment, so that input transformers may consume arbitrary types.
+ * TODO this paragraph refers to "assignability", which needs to be defined somewhere!
+ *
+ * When a transformer is registered for given input, it is called before the target method is
+ * invoked, and the outcome of the transformer is used in the invocation instead of the original
+ * value passed to the invoker by its caller.
+ *
+ * If the transformer declares the {@code Consumer} parameter, and the execution
+ * of the transformer calls {@code Consumer.accept()} with some {@code Runnable}, it is
+ * guaranteed that the {@code Runnable} will be called after the target method is invoked but
+ * before the invoker returns. These {@code Runnable}s are called cleanup tasks.
+ * The order of cleanup task execution is not specified. Passing a {@code null} cleanup task
+ * to the {@code Consumer} is permitted, but has no effect.
+ *
+ * If an input transformation is configured for an input for which a lookup is also configured,
+ * the lookup is performed first and the transformation is applied to the looked up value.
+ * If the looked up bean for some input is {@code @Dependent}, it is guaranteed that all
+ * cleanup tasks registered by a transformer for that input are called before that looked up
+ * {@code @Dependent} bean is destroyed.
+ *
+ * The order in which input transformations are performed in not specified and must not
+ * be relied upon.
+ *
+ *
Output transformations
+ *
+ * The target method has 2 kinds of outputs: the return value and the thrown exception. These
+ * outputs correspond to the return value of {@link Invoker#invoke(Object, Object[]) Invoker.invoke()}
+ * or its thrown exception, respectively.
+ *
+ * Each output can be transformed by a transformer that has one of the following signatures,
+ * where {@code X} and {@code Y} are types:
+ *
+ *
+ *
{@code static X transform(Y value)}
+ *
{@code X transform()} – in this case, {@code Y} is the type of the class that
+ * declares the transformer
+ *
+ *
+ * An output transformer must consume a type that can be produced by the target method.
+ * Specifically: when {@code Y} is any-type, it is not type checked during deployment.
+ * Otherwise, it is a deployment problem if {@code Y} is not assignable from the return type of
+ * the target method in case of return value transformers, or from {@code java.lang.Throwable}
+ * in case of exception transformers. {@code X} is not type checked during deployment, so that
+ * output transformers may produce arbitrary types.
+ * TODO this paragraph refers to "assignability", which needs to be defined somewhere!
+ *
+ * When a transformer is registered for given output, it is called after the target method
+ * is invoked, and the outcome of the transformer is passed back to the caller of the invoker
+ * instead of the original output produced by the target method.
+ *
+ * If the target method returns normally, any registered exception transformer is ignored; only
+ * the return value transformer is called. The return value transformer may throw, in which case
+ * the invoker will rethrow the exception. If the invoker is supposed to return normally,
+ * the return value transformer must return normally.
+ *
+ * Similarly, if the target method throws, any registered return value transformer is ignored;
+ * only the exception transformer is called. The exception transformer may return normally,
+ * in which case the invoker will return the return value of the exception transformer. If
+ * the invoker is supposed to throw an exception, the exception transformer must throw.
+ * TODO this requires that implementations catch java.lang.Throwable, which is perhaps a bit too much?
+ * maybe stick with java.lang.Exception?
+ *
+ *
Invoker wrapping
+ *
+ * An invoker, possibly utilizing input lookups and input/output transformations, may be wrapped
+ * by a custom piece of code for maximum flexibility. A wrapper must have the following signature,
+ * where {@code X}, {@code Y} and {@code Z} are types:
+ *
+ *
+ *
{@code static Z wrap(X instance, Object[] arguments, Invoker invoker)}
+ *
+ *
+ * A wrapper must operate on a matching instance type. Specifically: when {@code X} is
+ * any-type, it is not type checked during deployment. Otherwise, it is a deployment
+ * problem if {@code X} is not assignable from the class type of the bean class to which
+ * the target method belongs. {@code Y} and {@code Z} are not type checked during deployment.
+ *
+ * When a wrapper is registered, 2 invokers for the same method are created. The inner
+ * invoker applies all lookups and transformations, as described in previous sections, and
+ * invokes the target method. The outer invoker calls the wrapper with the passed
+ * instance and arguments and an instance of the inner invoker. The outer invoker is returned
+ * by this invoker builder.
+ *
+ * In other words, the outer invoker is equivalent to the following class:
+ *
+ *
+ * class InvokerWrapper implements Invoker<X, Z> {
+ * Z invoke(X instance, Object[] arguments) {
+ * // obtain the invoker as if no wrapper existed
+ * Invoker<X, Y> invoker = obtainInvoker();
+ * return SomeClass.wrap(instance, arguments, invoker);
+ * }
+ * }
+ *
+ *
+ * If the wrapper returns normally, the outer invoker returns its return value, unless the wrapper
+ * is declared {@code void}, in which case the outer invoker returns {@code null}. If the wrapper
+ * throws an exception, the outer invoker rethrows it directly.
+ *
+ * The wrapper is supposed to call the invoker it is passed, but does not necessarily have to.
+ * The wrapper may call the invoker multiple times. The wrapper must not use the invoker
+ * in any other way; specifically, it is forbidden to store the invoker instance anywhere
+ * or pass it to other methods that do not follow these rules. Doing so leads to non-portable
+ * behavior.
+ *
+ *
Type checking
+ *
+ * An invoker created by this builder has relaxed type checking rules, when compared to
+ * the description in {@link Invoker#invoke(Object, Object[]) Invoker.invoke()}, depending
+ * on configured lookups, transformers and wrapper. Some types are checked during
+ * deployment, as described in previous sections. Other types are checked during invocation,
+ * at the very least due to the type checks performed implicitly by the JVM. The lookups,
+ * transformers and the wrapper must arrange the inputs and outputs so that when the method
+ * is eventually invoked, the rules described in
+ * {@link Invoker#invoke(Object, Object[]) Invoker.invoke()} all hold.
+ *
+ * TODO specify what happens when a transformer/wrapper declares a parameter of a primitive type
+ * but the actual value passed to the invoker is `null` (the transformer should get a zero value?)
+ * TODO specify what happens when a transformer/wrapper declares a parameter of some type
+ * but the actual value passed to the invoker is not assignable to it (CCE?)
*
* @param type of outcome of this builder; always represents an {@code Invoker},
* but does not necessarily have to be an {@code Invoker} instance directly
* @since 4.1
*/
+// TODO more kinds of transformations could be defined, expecially for argument handling
+// TODO it would be possible to specify a sequence of transformations for each input/output, instead of just one
public interface InvokerBuilder {
+ /**
+ * Enables lookup of the target instance.
+ *
+ * @return this builder
+ */
+ InvokerBuilder setInstanceLookup();
+
+ /**
+ * Enables lookup of the argument on given {@code position}.
+ *
+ * @param position zero-based argument position for which lookup is enabled
+ * @return this builder
+ * @throws IllegalArgumentException if {@code position} is greather than or equal to
+ * the number of parameters declared by the target method
+ */
+ InvokerBuilder setArgumentLookup(int position);
+
+ /**
+ * Configures an input transformer for the target instance.
+ *
+ * @param clazz class that declares the transformer
+ * @param methodName transformer method name
+ * @return this builder
+ * @throws IllegalStateException if this method is called more than once
+ */
+ InvokerBuilder setInstanceTransformer(Class> clazz, String methodName);
+
+ /**
+ * Configures an input transformer for the argument on given {@code position}.
+ *
+ * @param position zero-based argument position for which the input transformer is configured
+ * @param clazz class that declares the transformer
+ * @param methodName transformer method name
+ * @return this builder
+ * @throws IllegalArgumentException if {@code position} is greather than or equal to
+ * the number of parameters declared by the target method
+ * @throws IllegalStateException if this method is called more than once with the same {@code position}
+ */
+ InvokerBuilder setArgumentTransformer(int position, Class> clazz, String methodName);
+
+ /**
+ * Configures an output transformer for the return value.
+ *
+ * @param clazz class that declares the transformer
+ * @param methodName transformer method name
+ * @return this builder
+ * @throws IllegalStateException if this method is called more than once
+ */
+ InvokerBuilder setReturnValueTransformer(Class> clazz, String methodName);
+
+ /**
+ * Configures an output transformer for the thrown exception.
+ *
+ * @param clazz class that declares the transformer
+ * @param methodName transformer method name
+ * @return this builder
+ * @throws IllegalStateException if this method is called more than once
+ */
+ InvokerBuilder setExceptionTransformer(Class> clazz, String methodName);
+
+ /**
+ * Configures an invoker wrapper.
+ *
+ * @param clazz class that declares the invoker wrapper
+ * @param methodName invoker wrapper method name
+ * @return this builder
+ * @throws IllegalStateException if this method is called more than once
+ */
+ InvokerBuilder setInvocationWrapper(Class> clazz, String methodName);
+
/**
* Returns the built {@link Invoker} or some represention of it. Implementations are allowed
- * but not required to reuse already built invokers for the same target method.
+ * but not required to reuse already built invokers for the same target method with the same
+ * configuration.
*
* @return the built invoker
*/
From 945c85c00de4edc20558cb129b95369df3af6353 Mon Sep 17 00:00:00 2001
From: Eclipse CDI Bot
Date: Fri, 13 Oct 2023 11:08:53 +0000
Subject: [PATCH 032/113] [maven-release-plugin] prepare release 4.1.0.Alpha1
---
api/pom.xml | 4 ++--
el/pom.xml | 2 +-
lang-model/pom.xml | 2 +-
pom.xml | 4 ++--
spec/pom.xml | 2 +-
5 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/api/pom.xml b/api/pom.xml
index 94405952..6030ebc6 100644
--- a/api/pom.xml
+++ b/api/pom.xml
@@ -21,7 +21,7 @@
jakarta.enterprisejakarta.enterprise.cdi-parent
- 4.1.0-SNAPSHOT
+ 4.1.0.Alpha1jakarta.enterprise.cdi-api
@@ -216,7 +216,7 @@
scm:git:git@github.com:cdi-spec/cdi.gitscm:git:git@github.com:cdi-spec/cdi.gitscm:git:git@github.com:cdi-spec/cdi.git
- HEAD
+ 4.1.0.Alpha1
diff --git a/el/pom.xml b/el/pom.xml
index a724101c..718ae8f9 100644
--- a/el/pom.xml
+++ b/el/pom.xml
@@ -4,7 +4,7 @@
jakarta.enterprisejakarta.enterprise.cdi-parent
- 4.1.0-SNAPSHOT
+ 4.1.0.Alpha1jakarta.enterprise.cdi-el-api
diff --git a/lang-model/pom.xml b/lang-model/pom.xml
index 8a580e4d..696a9b90 100644
--- a/lang-model/pom.xml
+++ b/lang-model/pom.xml
@@ -4,7 +4,7 @@
jakarta.enterprisejakarta.enterprise.cdi-parent
- 4.1.0-SNAPSHOT
+ 4.1.0.Alpha1jakarta.enterprise.lang-model
diff --git a/pom.xml b/pom.xml
index f196ef19..d52d067f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,7 +10,7 @@
jakarta.enterprisejakarta.enterprise.cdi-parentpom
- 4.1.0-SNAPSHOT
+ 4.1.0.Alpha1Parent module for CDI Specification
@@ -26,7 +26,7 @@
scm:git:git://github.com/eclipse-ee4j/cdi.gitscm:git:git@github.com:eclipse-ee4j/cdi.githttps://github.com/eclipse-ee4j/cdi
- HEAD
+ 4.1.0.Alpha1
diff --git a/spec/pom.xml b/spec/pom.xml
index 02b9de90..bd681800 100644
--- a/spec/pom.xml
+++ b/spec/pom.xml
@@ -4,7 +4,7 @@
jakarta.enterprisejakarta.enterprise.cdi-parent
- 4.1.0-SNAPSHOT
+ 4.1.0.Alpha1jakarta.enterprise.cdi-spec-doc
From 7aae05c007665b5e931610e00e46209749ccdfde Mon Sep 17 00:00:00 2001
From: Eclipse CDI Bot
Date: Fri, 13 Oct 2023 11:08:55 +0000
Subject: [PATCH 033/113] [maven-release-plugin] prepare for next development
iteration
---
api/pom.xml | 4 ++--
el/pom.xml | 2 +-
lang-model/pom.xml | 2 +-
pom.xml | 4 ++--
spec/pom.xml | 2 +-
5 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/api/pom.xml b/api/pom.xml
index 6030ebc6..94405952 100644
--- a/api/pom.xml
+++ b/api/pom.xml
@@ -21,7 +21,7 @@
jakarta.enterprisejakarta.enterprise.cdi-parent
- 4.1.0.Alpha1
+ 4.1.0-SNAPSHOTjakarta.enterprise.cdi-api
@@ -216,7 +216,7 @@
scm:git:git@github.com:cdi-spec/cdi.gitscm:git:git@github.com:cdi-spec/cdi.gitscm:git:git@github.com:cdi-spec/cdi.git
- 4.1.0.Alpha1
+ HEAD
diff --git a/el/pom.xml b/el/pom.xml
index 718ae8f9..a724101c 100644
--- a/el/pom.xml
+++ b/el/pom.xml
@@ -4,7 +4,7 @@
jakarta.enterprisejakarta.enterprise.cdi-parent
- 4.1.0.Alpha1
+ 4.1.0-SNAPSHOTjakarta.enterprise.cdi-el-api
diff --git a/lang-model/pom.xml b/lang-model/pom.xml
index 696a9b90..8a580e4d 100644
--- a/lang-model/pom.xml
+++ b/lang-model/pom.xml
@@ -4,7 +4,7 @@
jakarta.enterprisejakarta.enterprise.cdi-parent
- 4.1.0.Alpha1
+ 4.1.0-SNAPSHOTjakarta.enterprise.lang-model
diff --git a/pom.xml b/pom.xml
index d52d067f..f196ef19 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,7 +10,7 @@
jakarta.enterprisejakarta.enterprise.cdi-parentpom
- 4.1.0.Alpha1
+ 4.1.0-SNAPSHOTParent module for CDI Specification
@@ -26,7 +26,7 @@
scm:git:git://github.com/eclipse-ee4j/cdi.gitscm:git:git@github.com:eclipse-ee4j/cdi.githttps://github.com/eclipse-ee4j/cdi
- 4.1.0.Alpha1
+ HEAD
diff --git a/spec/pom.xml b/spec/pom.xml
index bd681800..02b9de90 100644
--- a/spec/pom.xml
+++ b/spec/pom.xml
@@ -4,7 +4,7 @@
jakarta.enterprisejakarta.enterprise.cdi-parent
- 4.1.0.Alpha1
+ 4.1.0-SNAPSHOTjakarta.enterprise.cdi-spec-doc
From 2c81adf3431dee5f542517ac06b93d6b6ab26c0a Mon Sep 17 00:00:00 2001
From: Ladislav Thon
Date: Wed, 25 Oct 2023 17:07:50 +0200
Subject: [PATCH 034/113] Allow setting CDI SPI implementations repeatedly
The `CDI.setCDIProvider()` method has been documented to throw
`IllegalStateException` on repeated calls since version 1.0, but since
version 2.0, the implementation in fact didn't honor this documentation.
Multiple implementations started to silently depend on repeated
`setCDIProvider()` calls being allowed, especially for testing.
We previously [1][2] fixed the implementation to actually do what
it documents, planning to release the fix in CDI 4.1, but it turns out
this is very inconvenient. Therefore, this commit makes repeated calls
of `setCDIProvider()` officially allowed. For consistency, it also
allows repeated calls of `BuildServicesResolver.setBuildServices()`.
[1] https://github.com/jakartaee/cdi/commit/82ec5d71872212364a321cd3700d0ecadf9162d2
[2] https://github.com/jakartaee/cdi/commit/8ead70bdd135d277e277dfffc086b58dd92a1de3
---
.../build/compatible/spi/BuildServicesResolver.java | 7 +------
api/src/main/java/jakarta/enterprise/inject/spi/CDI.java | 9 ++-------
2 files changed, 3 insertions(+), 13 deletions(-)
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BuildServicesResolver.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BuildServicesResolver.java
index 93380024..c8cda629 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BuildServicesResolver.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BuildServicesResolver.java
@@ -76,16 +76,11 @@ private static void discoverFactories() {
*
* @param instance a {@link BuildServices} instance that should be used, must not be {@code null}
* @throws IllegalArgumentException if the provided argument is null
- * @throws IllegalStateException if the {@link BuildServices} are already set
*/
public static void setBuildServices(BuildServices instance) {
if (instance == null) {
throw new IllegalArgumentException("BuildServices instance must not be null");
}
- if (configuredBuildServices == null) {
- configuredBuildServices = instance;
- } else {
- throw new IllegalStateException("BuildServices cannot be set repeatedly. Existing BuildServices are " + configuredBuildServices);
- }
+ configuredBuildServices = instance;
}
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/CDI.java b/api/src/main/java/jakarta/enterprise/inject/spi/CDI.java
index 1182a7ef..0a80f406 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/CDI.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/CDI.java
@@ -116,19 +116,14 @@ private static boolean checkProvider(CDIProvider c) {
*
*
* @param provider the provider to use
- * @throws IllegalStateException if the {@link CDIProvider} is already set
* @throws IllegalArgumentException if the provided argument is null
*/
public static void setCDIProvider(CDIProvider provider) {
if (provider == null) {
throw new IllegalArgumentException("CDIProvider must not be null");
}
- if (configuredProvider == null) {
- providerSetManually = true;
- configuredProvider = provider;
- } else {
- throw new IllegalStateException("CDIProvider cannot be set repeatedly. Existing provider is " + configuredProvider);
- }
+ providerSetManually = true;
+ configuredProvider = provider;
}
private static void findAllProviders() {
From 3855bf0fb80f9d7cd9a65be943199d7eecbaf8e8 Mon Sep 17 00:00:00 2001
From: Ladislav Thon
Date: Tue, 7 Nov 2023 16:52:04 +0100
Subject: [PATCH 035/113] Relax the scope requirement for public fields
Currently, the specification says that non-`@Dependent` beans may not have
public fields. This is overly restrictive; in particular, implementing this
rule precisely precludes passing the AtInject TCK, where `@Singleton` beans
have public fields.
This commit relaxes the requirement: all pseudo-scoped beans may have public
fields; normal scoped beans may not. This makes most sense, it is what all
existing implementations do (checked ArC, Weld and OpenWebBeans) and it is
how the TCK is already written.
---
spec/src/main/asciidoc/core/implementation.asciidoc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/spec/src/main/asciidoc/core/implementation.asciidoc b/spec/src/main/asciidoc/core/implementation.asciidoc
index 54859419..efaaa5c7 100644
--- a/spec/src/main/asciidoc/core/implementation.asciidoc
+++ b/spec/src/main/asciidoc/core/implementation.asciidoc
@@ -20,8 +20,8 @@ A _managed bean_ is a bean that is implemented by a Java class.
This class is called the _bean class_ of the managed bean.
The basic lifecycle and semantics of managed beans are defined by the Managed Beans specification.
-
-If a managed bean has a non-static public field, it must have scope `@Dependent`. If a managed bean with a non-static public field declares any scope other than `@Dependent`, the container automatically detects the problem and treats it as a definition error.
+If a managed bean has a non-static public field, its scope must be a <> (for example, `@Dependent` or `@Singleton`).
+If a managed bean with a non-static public field declares a normal scope, the container automatically detects the problem and treats it as a definition error.
If the managed bean class is a generic type, it must have scope `@Dependent`. If a managed bean with a parameterized bean class declares any scope other than `@Dependent`, the container automatically detects the problem and treats it as a definition error.
From 2ad1af2612640ed23841b23b891b4f425af9bd1e Mon Sep 17 00:00:00 2001
From: Ladislav Thon
Date: Tue, 14 Nov 2023 12:44:20 +0100
Subject: [PATCH 036/113] small improvements and clarifications in Build
Compatible Extensions and Language Model
---
.../spi/BuildCompatibleExtension.java | 7 ++---
.../build/compatible/spi/Registration.java | 4 +--
.../compatible/spi/SyntheticBeanBuilder.java | 4 +--
.../compatible/spi/SyntheticComponents.java | 8 +++---
.../lang/model/declarations/ClassInfo.java | 27 ++++++++++---------
5 files changed, 27 insertions(+), 23 deletions(-)
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BuildCompatibleExtension.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BuildCompatibleExtension.java
index 2b5e5859..452b5436 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BuildCompatibleExtension.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BuildCompatibleExtension.java
@@ -49,9 +49,10 @@
* Build compatible extensions may be annotated {@link SkipIfPortableExtensionPresent @SkipIfPortableExtensionPresent}
* when they are supposed to be ignored in presence of a given portable extension.
*
- * CDI implementations are not required to accept custom implementations of any {@code jakarta.enterprise.lang.model}
- * or {@code jakarta.enterprise.inject.build.compatible.spi} interface. In other words, users may only use instances
- * of these interfaces that they previously obtained from the corresponding API. If not, non-portable behavior results.
+ * CDI implementations are not required to accept custom implementations of any {@code jakarta.enterprise.lang.model},
+ * {@code jakarta.enterprise.invoke} or {@code jakarta.enterprise.inject.build.compatible.spi} interface
+ * on the API boundary of build compatible extensions. In other words, users may only use instances of these
+ * interfaces that they previously obtained from the corresponding API. If not, non-portable behavior results.
*
* In build compatible extensions, implementations of {@link jakarta.enterprise.lang.model.AnnotationTarget}
* only return annotations with the {@linkplain java.lang.annotation.RetentionPolicy#RUNTIME runtime} retention policy.
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/Registration.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/Registration.java
index 219f33d1..8870ad6b 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/Registration.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/Registration.java
@@ -41,8 +41,8 @@
* If the {@code @Registration} method has a parameter of type {@code ObserverInfo}, the method is called once
* for each observer whose observed event type is assignable to at least one expected type.
*
- * Note that interceptors are beans, and {@code InterceptorInfo} is a subtype of {@code BeanInfo}, so if the method
- * has a parameter of type {@code BeanInfo}, it will be called for interceptors as well.
+ * Note that {@code InterceptorInfo} is a subtype of {@code BeanInfo}, so if the method has a parameter
+ * of type {@code BeanInfo}, it will be called for interceptors as well.
*
* If the {@code @Registration} method doesn't declare any parameter of one of these types,
* or if it declares more than one, the container treats it as a definition error.
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticBeanBuilder.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticBeanBuilder.java
index 8afb2c94..8a74e44f 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticBeanBuilder.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticBeanBuilder.java
@@ -100,7 +100,8 @@ public interface SyntheticBeanBuilder {
/**
* Sets the scope of this synthetic bean to given scope type.
*
- * If not called, this synthetic bean will be {@code @Dependent}.
+ * If not called, and if no stereotype is added that defines a scope,
+ * this synthetic bean will be {@code @Dependent}.
*
* @param scopeAnnotation the scope type, must not be {@code null}
* @return this {@code SyntheticBeanBuilder}
@@ -131,7 +132,6 @@ public interface SyntheticBeanBuilder {
* that it is not enabled, which is equivalent to not registering it at all.
*
* If not called, this synthetic bean will not have a priority.
- * If this synthetic bean is not an alternative, the priority is ignored.
*
* @param priority the priority of this synthetic bean
* @return this {@code SyntheticBeanBuilder}
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticComponents.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticComponents.java
index 949d17af..d6ecc44a 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticComponents.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticComponents.java
@@ -20,14 +20,14 @@
public interface SyntheticComponents {
/**
* Creates a {@link SyntheticBeanBuilder} that allows configuring a new synthetic bean
- * of given {@code beanClass}. The synthetic bean will be registered at the end of
+ * of given {@code implementationClass}. The synthetic bean will be registered at the end of
* the {@link Synthesis @Synthesis} method.
*
- * @param beanClass the bean class of the new synthetic bean, must not be {@code null}
- * @param the bean class of the new synthetic bean
+ * @param implementationClass the implementation class of the new synthetic bean, must not be {@code null}
+ * @param the implementation class of the new synthetic bean
* @return a new {@link SyntheticBeanBuilder}, never {@code null}
*/
- SyntheticBeanBuilder addBean(Class beanClass);
+ SyntheticBeanBuilder addBean(Class implementationClass);
/**
* Creates a {@link SyntheticObserverBuilder} that allows configuring a new synthetic observer
diff --git a/lang-model/src/main/java/jakarta/enterprise/lang/model/declarations/ClassInfo.java b/lang-model/src/main/java/jakarta/enterprise/lang/model/declarations/ClassInfo.java
index 7155ae2f..4c0c16a0 100644
--- a/lang-model/src/main/java/jakarta/enterprise/lang/model/declarations/ClassInfo.java
+++ b/lang-model/src/main/java/jakarta/enterprise/lang/model/declarations/ClassInfo.java
@@ -61,34 +61,34 @@ public interface ClassInfo extends DeclarationInfo {
List typeParameters();
/**
- * Returns the {@linkplain Type type} of this class's superclass. Returns {@code null} if this class
+ * Returns the direct superclass {@linkplain Type type} of this class. Returns {@code null} if this class
* does not have a superclass; that is, if this class is {@code java.lang.Object} or an interface.
*
- * @return the type of this class's superclass, or {@code null} if there's no superclass
+ * @return the direct superclass type of this class, or {@code null} if there's no superclass
*/
Type superClass();
/**
- * Returns the {@linkplain ClassInfo declaration} of this class's superclass. Returns {@code null} if this class
+ * Returns the direct superclass of this class. Returns {@code null} if this class
* does not have a superclass; that is, if this class is {@code java.lang.Object} or an interface.
*
- * @return the declaration of this class's superclass, or {@code null} if there's no superclass
+ * @return the direct superclass of this class, or {@code null} if there's no superclass
*/
ClassInfo superClassDeclaration();
/**
- * Returns a list of {@linkplain Type types} of this class's direct superinterfaces.
+ * Returns a list of direct superinterface {@linkplain Type types} of this class.
* Returns an empty list if this class has no direct superinterface.
*
- * @return immutable list of types of this class's direct superinterfaces, never {@code null}
+ * @return immutable list of direct superinterface types of this class, never {@code null}
*/
List superInterfaces();
/**
- * Returns a list of {@linkplain ClassInfo declarations} of this class's direct superinterfaces.
+ * Returns a list of direct superinterfaces of this class.
* Returns an empty list if this class has no direct superinterface.
*
- * @return immutable list of declarations of this class's direct superinterfaces, never {@code null}
+ * @return immutable list of direct superinterfaces of this class, never {@code null}
*/
List superInterfacesDeclarations();
@@ -169,8 +169,10 @@ public interface ClassInfo extends DeclarationInfo {
/**
* Returns a collection of {@linkplain MethodInfo methods} declared or implicitly declared
* in this class and all its superclasses up to and excluding {@code java.lang.Object},
- * as well as all direct and indirect superinterfaces. If this class is an interface,
- * only superinterfaces are considered. Methods implicitly declared in interfaces are omitted.
+ * as well as all direct and indirect superinterfaces. If this class is {@code java.lang.Object},
+ * its methods are not excluded. If this class is an interface, only superinterfaces
+ * are considered. Implicitly declared methods corresponding to {@code java.lang.Object}
+ * methods in interfaces are omitted.
*
* If the collection of methods described above contains multiple methods with the same signature,
* all such methods are returned. {@link MethodInfo#declaringClass() MethodInfo.declaringClass}
@@ -186,8 +188,9 @@ public interface ClassInfo extends DeclarationInfo {
/**
* Returns a collection of {@linkplain FieldInfo fields} declared or implicitly declared
* in this class and all its superclasses up to and excluding {@code java.lang.Object},
- * as well as all direct and indirect superinterfaces. If this class is an interface,
- * only superinterfaces are considered.
+ * as well as all direct and indirect superinterfaces. If this class is {@code java.lang.Object},
+ * its fields are not excluded. If this class is an interface, only superinterfaces
+ * are considered.
*
* If the collection of fields described above contains multiple fields with the same name,
* all such fields are returned. {@link FieldInfo#declaringClass() FieldInfo.declaringClass}
From 5472628a0cd6a353b71a53a7eead5dfaf80f657e Mon Sep 17 00:00:00 2001
From: Said BOUDJELDA
Date: Sun, 26 Nov 2023 10:57:56 +0100
Subject: [PATCH 037/113] fix typo in javadoc
---
.../jakarta/enterprise/lang/model/declarations/MethodInfo.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lang-model/src/main/java/jakarta/enterprise/lang/model/declarations/MethodInfo.java b/lang-model/src/main/java/jakarta/enterprise/lang/model/declarations/MethodInfo.java
index d86b9f78..e896dff0 100644
--- a/lang-model/src/main/java/jakarta/enterprise/lang/model/declarations/MethodInfo.java
+++ b/lang-model/src/main/java/jakarta/enterprise/lang/model/declarations/MethodInfo.java
@@ -20,7 +20,7 @@ public interface MethodInfo extends DeclarationInfo {
/**
* Returns a list of {@linkplain ParameterInfo parameters} declared or implicitly declared on this method.
*
- * @return immutable list of {@linkplain ParameterInfo parameterts}, never {@code null}
+ * @return immutable list of {@linkplain ParameterInfo parameters}, never {@code null}
*/
List parameters();
From 6c020d376eb74196676352097cf0ff29dce21c0a Mon Sep 17 00:00:00 2001
From: Said BOUDJELDA
Date: Sun, 26 Nov 2023 14:36:11 +0100
Subject: [PATCH 038/113] update copyright year
---
lang-model/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lang-model/pom.xml b/lang-model/pom.xml
index 8a580e4d..dc3b9086 100644
--- a/lang-model/pom.xml
+++ b/lang-model/pom.xml
@@ -92,7 +92,7 @@
diff --git a/spec/src/main/asciidoc/cdi-spec.asciidoc b/spec/src/main/asciidoc/cdi-spec.asciidoc
index 9f977403..6f5be6c1 100644
--- a/spec/src/main/asciidoc/cdi-spec.asciidoc
+++ b/spec/src/main/asciidoc/cdi-spec.asciidoc
@@ -1,9 +1,9 @@
= Jakarta Contexts and Dependency Injection
:author: Jakarta Contexts and Dependency Injection Specification Project
:email: cdi-dev@eclipse.org
-:revnumber: 4.1
-:revdate: May 24 2023
-:revremark: Draft
+:revnumber: {revnumber}
+:revdate: {revdate}
+:revremark: {revremark}
:version-label!:
:sectanchors:
:doctype: book
diff --git a/spec/src/main/asciidoc/license-asl2.asciidoc b/spec/src/main/asciidoc/license-asl2.asciidoc
index c01ed412..684bb5e5 100644
--- a/spec/src/main/asciidoc/license-asl2.asciidoc
+++ b/spec/src/main/asciidoc/license-asl2.asciidoc
@@ -11,7 +11,7 @@ Specification Lead: Red Hat, Inc.
Release: {revdate}
-Copyright 2017,2022 Red Hat, Inc.
+Copyright 2017,2023 Red Hat, Inc.
100 East Davie Street, Raleigh, NC 27601, U.S.A.
Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/src/main/asciidoc/license-final.asciidoc b/spec/src/main/asciidoc/license-final.asciidoc
index affd1c0d..ba45debf 100644
--- a/spec/src/main/asciidoc/license-final.asciidoc
+++ b/spec/src/main/asciidoc/license-final.asciidoc
@@ -14,7 +14,7 @@ Release: {revdate}
=== Final license
-Copyright 2018,2022 Eclipse Foundation.
+Copyright 2018,2023 Eclipse Foundation.
This specification is licensed under the Eclipse Foundation Specification License 1.0; this specification is based on material that is licensed under the Apache License, version 2.0.
From 544de85e8650b23259cf69caca0b8f262e4c9e13 Mon Sep 17 00:00:00 2001
From: Scott M Stark
Date: Thu, 30 Nov 2023 11:29:10 -0600
Subject: [PATCH 046/113] Updates for deprecation of the Managed Beans
specification, #679 (#709)
* Updates for deprecation of the Managed Beans specification, #679
---------
Signed-off-by: Scott M Stark
---
spec/src/main/asciidoc/architecture.asciidoc | 16 +---------------
.../main/asciidoc/core/implementation.asciidoc | 1 -
spec/src/main/asciidoc/core/lifecycle.asciidoc | 4 ++--
3 files changed, 3 insertions(+), 18 deletions(-)
diff --git a/spec/src/main/asciidoc/architecture.asciidoc b/spec/src/main/asciidoc/architecture.asciidoc
index 976f9747..31985d73 100644
--- a/spec/src/main/asciidoc/architecture.asciidoc
+++ b/spec/src/main/asciidoc/architecture.asciidoc
@@ -15,7 +15,7 @@ This specification defines a powerful set of complementary services that help to
The services defined by this specification allow objects to be bound to lifecycle contexts, to be injected, to be associated with interceptors and decorators, and to interact in a loosely coupled fashion by firing and observing events.
-Various kinds of objects are injectable, including Jakarta Enterprise Bean 3 session beans, managed beans and Jakarta EE resources.
+Various kinds of objects are injectable, including Jakarta Enterprise Bean 3 session beans, and Jakarta EE resources.
We refer to these objects in general terms as _beans_ and to instances of beans that belong to contexts as _contextual instances_.
Contextual instances may be injected into other objects by the dependency injection service.
@@ -84,20 +84,6 @@ Message-driven and entity beans are by nature non-contextual objects and may not
The container performs dependency injection on all session and message-driven bean instances, even those which are not contextual instances.
-==== Relationship to managed beans
-
-The Managed Beans specification defines the basic programming model for application components managed by the Jakarta EE container.
-
-As defined by this specification, most Java classes, including all Jakarta Enterprise Beans, are managed beans.
-
-This specification defines contextual lifecycle management and dependency injection as generic services applicable to all managed beans.
-
-Any managed bean instance obtained via the dependency injection service is a contextual instance. It is bound to a lifecycle context and is available to other objects that execute in that context.
-The container automatically creates the instance when it is needed by a client.
-When the context ends, the container automatically destroys the instance.
-
-The container performs dependency injection on all managed bean instances, even those which are not contextual instances.
-
==== Relationship to Jakarta Dependency Injection
The Jakarta Dependency Injection specification defines a set of annotations for the declaring injected fields, methods and constructors of a bean.
diff --git a/spec/src/main/asciidoc/core/implementation.asciidoc b/spec/src/main/asciidoc/core/implementation.asciidoc
index efaaa5c7..c8495888 100644
--- a/spec/src/main/asciidoc/core/implementation.asciidoc
+++ b/spec/src/main/asciidoc/core/implementation.asciidoc
@@ -18,7 +18,6 @@ Portable extensions and build compatible extensions may provide other kinds of b
A _managed bean_ is a bean that is implemented by a Java class.
This class is called the _bean class_ of the managed bean.
-The basic lifecycle and semantics of managed beans are defined by the Managed Beans specification.
If a managed bean has a non-static public field, its scope must be a <> (for example, `@Dependent` or `@Singleton`).
If a managed bean with a non-static public field declares a normal scope, the container automatically detects the problem and treats it as a definition error.
diff --git a/spec/src/main/asciidoc/core/lifecycle.asciidoc b/spec/src/main/asciidoc/core/lifecycle.asciidoc
index 917cf051..eabd5dd9 100644
--- a/spec/src/main/asciidoc/core/lifecycle.asciidoc
+++ b/spec/src/main/asciidoc/core/lifecycle.asciidoc
@@ -109,9 +109,9 @@ The actual mechanics of bean creation and destruction varies according to what k
==== Lifecycle of managed beans
-When the `create()` method of the `Bean` object that represents a managed bean is called, the container obtains an instance of the bean, as defined by the Managed Beans specification, calling the bean constructor as defined by <>, and performing dependency injection as defined in <>.
+When the `create()` method of the `Bean` object that represents a managed bean is called, the container obtains an instance of the bean, calling the bean constructor as defined by <>, and performing dependency injection as defined in <>.
-When the `destroy()` method is called, the container destroys the instance, as defined by the Managed Beans specification, and any dependent objects, as defined in <>.
+When the `destroy()` method is called, the container destroys the instance, and any dependent objects, as defined in <>.
From d3272a42489be1a3a6a55c6f78c71f7f215db286 Mon Sep 17 00:00:00 2001
From: Scott M Stark
Date: Thu, 30 Nov 2023 11:33:17 -0600
Subject: [PATCH 047/113] Updates for Jakarta Bean Validation to Jakarta
Validation name change, #680 (#708)
* Updates for Jakarta Bean Validation to Jakarta Validation name change, #680
* Update spec/src/main/asciidoc/architecture.asciidoc
Co-authored-by: Ladislav Thon
---------
Signed-off-by: Scott M Stark
Co-authored-by: Ladislav Thon
---
spec/src/main/asciidoc/architecture.asciidoc | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/spec/src/main/asciidoc/architecture.asciidoc b/spec/src/main/asciidoc/architecture.asciidoc
index 31985d73..66c36c33 100644
--- a/spec/src/main/asciidoc/architecture.asciidoc
+++ b/spec/src/main/asciidoc/architecture.asciidoc
@@ -100,13 +100,13 @@ Jakarta Server Faces is a web-tier presentation framework that provides a compon
This specification allows any bean to be assigned a name. Thus, a Jakarta Server Faces application may take advantage of the sophisticated context and dependency injection model defined by this specification.
-==== Relationship to Jakarta Bean Validation
+==== Relationship to Jakarta Validation
-Jakarta Bean Validation provides a unified way of declaring and defining constraints on an object model, defines a runtime engine to validate objects and provides method validation.
+Jakarta Validation provides a unified way of declaring and defining constraints on an object model, defines a runtime engine to validate objects and provides method validation.
-The Jakarta Bean Validation specification defines beans for Bean Validation managed objects including `Validator` and `ValidatorFactory`.
-A number of Bean Validation managed instances, including `ConstraintValidator` s can take advantage of dependency injection.
-Bean Validation also provides support for method parameter validation on any bean.
+The Jakarta Validation specification defines beans for certain managed objects, including `Validator` and `ValidatorFactory`.
+A number of Jakarta Validation managed instances, including ``ConstraintValidator``s, can take advantage of dependency injection.
+Jakarta Validation also provides support for method parameter validation on any bean.
=== Introductory examples
From 37346f5f1b9f03e0af1df5d83527a4e97824d6e9 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Thu, 30 Nov 2023 11:49:03 -0600
Subject: [PATCH 048/113] Bump nokogiri from 1.13.6 to 1.14.3 in /docs (#662)
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.6 to 1.14.3.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.13.6...v1.14.3)
---
updated-dependencies:
- dependency-name: nokogiri
dependency-type: indirect
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
docs/Gemfile.lock | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock
index 2cc62c7b..7754759d 100644
--- a/docs/Gemfile.lock
+++ b/docs/Gemfile.lock
@@ -229,9 +229,9 @@ GEM
jekyll-seo-tag (~> 2.1)
minitest (5.15.0)
multipart-post (2.1.1)
- nokogiri (1.13.6-x86_64-darwin)
+ nokogiri (1.14.3-x86_64-darwin)
racc (~> 1.4)
- nokogiri (1.13.6-x86_64-linux)
+ nokogiri (1.14.3-x86_64-linux)
racc (~> 1.4)
octokit (4.22.0)
faraday (>= 0.9)
@@ -239,7 +239,7 @@ GEM
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.6)
- racc (1.6.0)
+ racc (1.6.2)
rb-fsevent (0.11.0)
rb-inotify (0.10.1)
ffi (~> 1.0)
From 407667216e5d8816ba98c4b767b3ac91d6d6d770 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Thu, 30 Nov 2023 11:49:18 -0600
Subject: [PATCH 049/113] Bump webrick from 1.7.0 to 1.8.1 in /docs (#716)
Bumps [webrick](https://github.com/ruby/webrick) from 1.7.0 to 1.8.1.
- [Release notes](https://github.com/ruby/webrick/releases)
- [Commits](https://github.com/ruby/webrick/compare/v1.7.0...v1.8.1)
---
updated-dependencies:
- dependency-name: webrick
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
docs/Gemfile | 2 +-
docs/Gemfile.lock | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/docs/Gemfile b/docs/Gemfile
index b96ce0af..d490aa01 100644
--- a/docs/Gemfile
+++ b/docs/Gemfile
@@ -28,4 +28,4 @@ end
gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]
-gem "webrick", "~> 1.7"
+gem "webrick", "~> 1.8"
diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock
index 7754759d..4dde5cc3 100644
--- a/docs/Gemfile.lock
+++ b/docs/Gemfile.lock
@@ -271,7 +271,7 @@ GEM
unf_ext
unf_ext (0.0.8)
unicode-display_width (1.8.0)
- webrick (1.7.0)
+ webrick (1.8.1)
zeitwerk (2.5.3)
PLATFORMS
@@ -285,7 +285,7 @@ DEPENDENCIES
tzinfo (~> 1.2)
tzinfo-data
wdm (~> 0.1.1)
- webrick (~> 1.7)
+ webrick (~> 1.8)
BUNDLED WITH
2.3.5
From 873aa7f64d374653919913fae57a1edf7e779965 Mon Sep 17 00:00:00 2001
From: Scott M Stark
Date: Thu, 30 Nov 2023 11:53:33 -0600
Subject: [PATCH 050/113] + Change Jakarta Server Faces to Jakarta Faces, #681
(#724)
Signed-off-by: Scott M Stark
---
spec/src/main/asciidoc/architecture.asciidoc | 20 ++++++++++----------
spec/src/main/asciidoc/dictionary.txt | 2 +-
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/spec/src/main/asciidoc/architecture.asciidoc b/spec/src/main/asciidoc/architecture.asciidoc
index 66c36c33..f9a5fc09 100644
--- a/spec/src/main/asciidoc/architecture.asciidoc
+++ b/spec/src/main/asciidoc/architecture.asciidoc
@@ -6,7 +6,7 @@ This specification defines a powerful set of complementary services that help to
* A well-defined lifecycle for stateful objects bound to _lifecycle contexts_, where the set of contexts is extensible
* A sophisticated, typesafe _dependency injection_ mechanism, including the ability to select dependencies at either development or deployment time, without verbose configuration
* Support for Jakarta EE modularity and the Jakarta EE component architecture - the modular structure of a Jakarta EE application is taken into account when resolving dependencies between Jakarta EE components
-* Integration with the Jakarta Unified Expression Language (EL), allowing any contextual object to be used directly within a Jakarta Server Faces or JSP page
+* Integration with the Jakarta Unified Expression Language (EL), allowing any contextual object to be used directly within a Jakarta Faces or JSP page
* The ability to _decorate_ injected objects (only in {cdi_full} environment)
* The ability to associate interceptors to objects via typesafe _interceptor bindings_
* An _event notification_ model
@@ -22,7 +22,7 @@ Contextual instances may be injected into other objects by the dependency inject
To take advantage of these facilities, the developer provides additional bean-level metadata in the form of Java annotations and application-level metadata in the form of an XML descriptor.
The use of these services significantly simplifies the task of creating Jakarta EE applications by integrating the Jakarta EE web tier with Jakarta EE enterprise services.
-In particular, Jakarta Enterprise Bean components may be used as Jakarta Server Faces managed beans, thus integrating the programming models of Jakarta Enterprise Bean and Jakarta Server Faces.
+In particular, Jakarta Enterprise Bean components may be used as Jakarta Faces managed beans, thus integrating the programming models of Jakarta Enterprise Bean and Jakarta Faces.
It's even possible to integrate with third-party frameworks.
A portable extension may provide objects to be injected or obtain contextual instances using the dependency injection service. The framework may even raise and observe events using the event notification service.
@@ -94,11 +94,11 @@ The dependency injection service makes use of these annotations.
The Jakarta Interceptors specification defines the basic programming model and semantics for interceptors.
This specification enhances that model by providing the ability to associate interceptors with beans using typesafe interceptor bindings.
-==== Relationship to Jakarta Server Faces
+==== Relationship to Jakarta Faces
-Jakarta Server Faces is a web-tier presentation framework that provides a component model for graphical user interface components and an event-driven interaction model that binds user interface components to objects accessible via Unified EL.
+Jakarta Faces is a web-tier presentation framework that provides a component model for graphical user interface components and an event-driven interaction model that binds user interface components to objects accessible via Unified EL.
-This specification allows any bean to be assigned a name. Thus, a Jakarta Server Faces application may take advantage of the sophisticated context and dependency injection model defined by this specification.
+This specification allows any bean to be assigned a name. Thus, a Jakarta Faces application may take advantage of the sophisticated context and dependency injection model defined by this specification.
==== Relationship to Jakarta Validation
@@ -112,9 +112,9 @@ Jakarta Validation also provides support for method parameter validation on any
The following examples demonstrate the use of lifecycle contexts and dependency injection.
-==== Jakarta Server Faces example
+==== Jakarta Faces example
-The following Jakarta Server Faces page defines a login prompt for a web application:
+The following Jakarta Faces page defines a login prompt for a web application:
[source, xml]
----
@@ -134,7 +134,7 @@ The following Jakarta Server Faces page defines a login prompt for a web applica
The Jakarta EL expressions in this page refer to beans named `credentials` and `login`.
-The `Credentials` bean has a lifecycle that is bound to the Jakarta Server Faces request:
+The `Credentials` bean has a lifecycle that is bound to the Jakarta Faces request:
[source, java]
----
@@ -261,8 +261,8 @@ public class DocumentEditor {
The `@Documents` annotation is another application-defined qualifier type. The use of distinct qualifier types enables the container to distinguish which Jakarta Persistence persistence unit is required.
-When the login form is submitted, Jakarta Server Faces assigns the entered username and password to an instance of the `Credentials` bean that is automatically instantiated by the container.
-Next, Jakarta Server Faces calls the `login()` method of an instance of `Login` that is automatically instantiated by the container.
+When the login form is submitted, Jakarta Faces assigns the entered username and password to an instance of the `Credentials` bean that is automatically instantiated by the container.
+Next, Jakarta Faces calls the `login()` method of an instance of `Login` that is automatically instantiated by the container.
This instance continues to exist for and be available to other requests in the same HTTP session, and provides the `User` object representing the current user to any other bean that requires it (for example, `DocumentEditor`). If the producer method is called before the `login()` method initializes the user object, it throws a `NotLoggedInException`.
==== Jakarta Enterprise Bean example
diff --git a/spec/src/main/asciidoc/dictionary.txt b/spec/src/main/asciidoc/dictionary.txt
index 5b6eab00..0154ced7 100644
--- a/spec/src/main/asciidoc/dictionary.txt
+++ b/spec/src/main/asciidoc/dictionary.txt
@@ -36,7 +36,7 @@ JDK
JMS
JNDI
JPA
-Jakarta Server Faces
+Jakarta Faces
JSP
JSR
JTA
From 703a7a2764afdc3e0600b68a9548760ec85cc20a Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Thu, 30 Nov 2023 11:54:54 -0600
Subject: [PATCH 051/113] Bump github-pages from 219 to 225 in /docs (#718)
Bumps [github-pages](https://github.com/github/pages-gem) from 219 to 225.
- [Release notes](https://github.com/github/pages-gem/releases)
- [Commits](https://github.com/github/pages-gem/compare/v219...v225)
---
updated-dependencies:
- dependency-name: github-pages
dependency-type: direct:development
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
docs/Gemfile | 2 +-
docs/Gemfile.lock | 116 ++++++++++++++++++++--------------------------
2 files changed, 50 insertions(+), 68 deletions(-)
diff --git a/docs/Gemfile b/docs/Gemfile
index d490aa01..6742ea5c 100644
--- a/docs/Gemfile
+++ b/docs/Gemfile
@@ -12,7 +12,7 @@ gem "jekyll", "~> 3.9.0"
gem "minima", "~> 2.5"
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
-gem "github-pages", "~> 219", group: :jekyll_plugins
+gem "github-pages", "~> 225", group: :jekyll_plugins
# If you have any plugins, put them here!
group :jekyll_plugins do
end
diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock
index 4dde5cc3..a3c431cc 100644
--- a/docs/Gemfile.lock
+++ b/docs/Gemfile.lock
@@ -1,67 +1,50 @@
GEM
remote: https://rubygems.org/
specs:
- activesupport (6.0.4.4)
+ activesupport (6.0.6.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2, >= 2.2.2)
- addressable (2.8.0)
- public_suffix (>= 2.0.2, < 5.0)
+ addressable (2.8.5)
+ public_suffix (>= 2.0.2, < 6.0)
+ base64 (0.2.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.11.1)
colorator (1.1.0)
- commonmarker (0.17.13)
- ruby-enum (~> 0.5)
- concurrent-ruby (1.1.9)
- dnsruby (1.61.9)
- simpleidn (~> 0.1)
+ commonmarker (0.23.10)
+ concurrent-ruby (1.2.2)
+ dnsruby (1.70.0)
+ simpleidn (~> 0.2.1)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
- ethon (0.15.0)
+ ethon (0.16.0)
ffi (>= 1.15.0)
eventmachine (1.2.7)
- execjs (2.8.1)
- faraday (1.9.3)
- faraday-em_http (~> 1.0)
- faraday-em_synchrony (~> 1.0)
- faraday-excon (~> 1.1)
- faraday-httpclient (~> 1.0)
- faraday-multipart (~> 1.0)
- faraday-net_http (~> 1.0)
- faraday-net_http_persistent (~> 1.0)
- faraday-patron (~> 1.0)
- faraday-rack (~> 1.0)
- faraday-retry (~> 1.0)
+ execjs (2.9.1)
+ faraday (2.7.12)
+ base64
+ faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
- faraday-em_http (1.0.0)
- faraday-em_synchrony (1.0.0)
- faraday-excon (1.1.0)
- faraday-httpclient (1.0.1)
- faraday-multipart (1.0.3)
- multipart-post (>= 1.2, < 3)
- faraday-net_http (1.0.1)
- faraday-net_http_persistent (1.2.0)
- faraday-patron (1.0.0)
- faraday-rack (1.0.0)
- faraday-retry (1.0.3)
- ffi (1.15.5)
+ faraday-net_http (3.0.2)
+ ffi (1.16.3)
forwardable-extended (2.6.0)
gemoji (3.0.1)
- github-pages (219)
- github-pages-health-check (= 1.17.7)
+ github-pages (225)
+ github-pages-health-check (= 1.17.9)
jekyll (= 3.9.0)
jekyll-avatar (= 0.7.0)
jekyll-coffeescript (= 1.1.1)
- jekyll-commonmark-ghpages (= 0.1.6)
+ jekyll-commonmark-ghpages (= 0.2.0)
jekyll-default-layout (= 0.1.4)
jekyll-feed (= 0.15.1)
jekyll-gist (= 1.5.0)
jekyll-github-metadata (= 2.13.0)
+ jekyll-include-cache (= 0.2.1)
jekyll-mentions (= 1.6.0)
jekyll-optional-front-matter (= 0.3.2)
jekyll-paginate (= 1.1.0)
@@ -70,7 +53,7 @@ GEM
jekyll-relative-links (= 0.6.1)
jekyll-remote-theme (= 0.4.3)
jekyll-sass-converter (= 1.5.2)
- jekyll-seo-tag (= 2.7.1)
+ jekyll-seo-tag (= 2.8.0)
jekyll-sitemap (= 1.4.0)
jekyll-swiss (= 1.0.0)
jekyll-theme-architect (= 0.2.0)
@@ -93,16 +76,16 @@ GEM
liquid (= 4.0.3)
mercenary (~> 0.3)
minima (= 2.5.1)
- nokogiri (>= 1.10.4, < 2.0)
+ nokogiri (>= 1.12.5, < 2.0)
rouge (= 3.26.0)
terminal-table (~> 1.4)
- github-pages-health-check (1.17.7)
+ github-pages-health-check (1.17.9)
addressable (~> 2.3)
dnsruby (~> 1.60)
octokit (~> 4.0)
public_suffix (>= 3.0, < 5.0)
typhoeus (~> 1.3)
- html-pipeline (2.14.0)
+ html-pipeline (2.14.3)
activesupport (>= 2)
nokogiri (>= 1.4)
http_parser.rb (0.8.0)
@@ -126,12 +109,12 @@ GEM
jekyll-coffeescript (1.1.1)
coffee-script (~> 2.2)
coffee-script-source (~> 1.11.1)
- jekyll-commonmark (1.3.1)
- commonmarker (~> 0.14)
- jekyll (>= 3.7, < 5.0)
- jekyll-commonmark-ghpages (0.1.6)
- commonmarker (~> 0.17.6)
- jekyll-commonmark (~> 1.2)
+ jekyll-commonmark (1.4.0)
+ commonmarker (~> 0.22)
+ jekyll-commonmark-ghpages (0.2.0)
+ commonmarker (~> 0.23.4)
+ jekyll (~> 3.9.0)
+ jekyll-commonmark (~> 1.4.0)
rouge (>= 2.0, < 4.0)
jekyll-default-layout (0.1.4)
jekyll (~> 3.0)
@@ -142,6 +125,8 @@ GEM
jekyll-github-metadata (2.13.0)
jekyll (>= 3.4, < 5.0)
octokit (~> 4.0, != 4.4.0)
+ jekyll-include-cache (0.2.1)
+ jekyll (>= 3.7, < 5.0)
jekyll-mentions (1.6.0)
html-pipeline (~> 2.3)
jekyll (>= 3.7, < 5.0)
@@ -161,7 +146,7 @@ GEM
rubyzip (>= 1.3.0, < 3.0)
jekyll-sass-converter (1.5.2)
sass (~> 3.4)
- jekyll-seo-tag (2.7.1)
+ jekyll-seo-tag (2.8.0)
jekyll (>= 3.8, < 5.0)
jekyll-sitemap (1.4.0)
jekyll (>= 3.7, < 5.0)
@@ -219,7 +204,7 @@ GEM
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.3)
- listen (3.7.1)
+ listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.3.6)
@@ -227,26 +212,23 @@ GEM
jekyll (>= 3.5, < 5.0)
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
- minitest (5.15.0)
- multipart-post (2.1.1)
- nokogiri (1.14.3-x86_64-darwin)
+ minitest (5.20.0)
+ nokogiri (1.15.5-x86_64-darwin)
racc (~> 1.4)
- nokogiri (1.14.3-x86_64-linux)
+ nokogiri (1.15.5-x86_64-linux)
racc (~> 1.4)
- octokit (4.22.0)
- faraday (>= 0.9)
- sawyer (~> 0.8.0, >= 0.5.3)
+ octokit (4.25.1)
+ faraday (>= 1, < 3)
+ sawyer (~> 0.9)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
- public_suffix (4.0.6)
- racc (1.6.2)
- rb-fsevent (0.11.0)
+ public_suffix (4.0.7)
+ racc (1.7.3)
+ rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
- rexml (3.2.5)
+ rexml (3.2.6)
rouge (3.26.0)
- ruby-enum (0.9.0)
- i18n
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
safe_yaml (1.0.5)
@@ -255,31 +237,31 @@ GEM
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
- sawyer (0.8.2)
+ sawyer (0.9.2)
addressable (>= 2.3.5)
- faraday (> 0.8, < 2.0)
+ faraday (>= 0.17.3, < 3)
simpleidn (0.2.1)
unf (~> 0.1.4)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
thread_safe (0.3.6)
- typhoeus (1.4.0)
+ typhoeus (1.4.1)
ethon (>= 0.9.0)
tzinfo (1.2.9)
thread_safe (~> 0.1)
unf (0.1.4)
unf_ext
- unf_ext (0.0.8)
+ unf_ext (0.0.9.1)
unicode-display_width (1.8.0)
webrick (1.8.1)
- zeitwerk (2.5.3)
+ zeitwerk (2.6.12)
PLATFORMS
x86_64-darwin-19
x86_64-linux
DEPENDENCIES
- github-pages (~> 219)
+ github-pages (~> 225)
jekyll (~> 3.9.0)
minima (~> 2.5)
tzinfo (~> 1.2)
From d01b2a64d894ddb713a8940cc951140291f449b3 Mon Sep 17 00:00:00 2001
From: Eclipse CDI Bot
Date: Thu, 30 Nov 2023 18:09:02 +0000
Subject: [PATCH 052/113] [maven-release-plugin] prepare release 4.1.0-M1
---
api/pom.xml | 4 ++--
el/pom.xml | 2 +-
lang-model/pom.xml | 2 +-
pom.xml | 4 ++--
spec/pom.xml | 2 +-
5 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/api/pom.xml b/api/pom.xml
index fc018c0d..2851cfdf 100644
--- a/api/pom.xml
+++ b/api/pom.xml
@@ -21,7 +21,7 @@
jakarta.enterprisejakarta.enterprise.cdi-parent
- 4.1.0-SNAPSHOT
+ 4.1.0-M1jakarta.enterprise.cdi-api
@@ -217,7 +217,7 @@
scm:git:git@github.com:cdi-spec/cdi.gitscm:git:git@github.com:cdi-spec/cdi.gitscm:git:git@github.com:cdi-spec/cdi.git
- HEAD
+ 4.1.0-M1
diff --git a/el/pom.xml b/el/pom.xml
index 89d31555..205a96b2 100644
--- a/el/pom.xml
+++ b/el/pom.xml
@@ -4,7 +4,7 @@
jakarta.enterprisejakarta.enterprise.cdi-parent
- 4.1.0-SNAPSHOT
+ 4.1.0-M1jakarta.enterprise.cdi-el-api
diff --git a/lang-model/pom.xml b/lang-model/pom.xml
index dc905c86..86ea050a 100644
--- a/lang-model/pom.xml
+++ b/lang-model/pom.xml
@@ -4,7 +4,7 @@
jakarta.enterprisejakarta.enterprise.cdi-parent
- 4.1.0-SNAPSHOT
+ 4.1.0-M1jakarta.enterprise.lang-model
diff --git a/pom.xml b/pom.xml
index f09700c8..259da341 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,7 +10,7 @@
jakarta.enterprisejakarta.enterprise.cdi-parentpom
- 4.1.0-SNAPSHOT
+ 4.1.0-M1Parent module for CDI Specification
@@ -26,7 +26,7 @@
scm:git:git://github.com/eclipse-ee4j/cdi.gitscm:git:git@github.com:eclipse-ee4j/cdi.githttps://github.com/eclipse-ee4j/cdi
- HEAD
+ 4.1.0-M1
diff --git a/spec/pom.xml b/spec/pom.xml
index a00c29e2..485c5c52 100644
--- a/spec/pom.xml
+++ b/spec/pom.xml
@@ -4,7 +4,7 @@
jakarta.enterprisejakarta.enterprise.cdi-parent
- 4.1.0-SNAPSHOT
+ 4.1.0-M1jakarta.enterprise.cdi-spec-doc
From ecec955616c9e9b37a01f738824a5a5c1d287db0 Mon Sep 17 00:00:00 2001
From: Eclipse CDI Bot
Date: Thu, 30 Nov 2023 18:09:04 +0000
Subject: [PATCH 053/113] [maven-release-plugin] prepare for next development
iteration
---
api/pom.xml | 4 ++--
el/pom.xml | 2 +-
lang-model/pom.xml | 2 +-
pom.xml | 4 ++--
spec/pom.xml | 2 +-
5 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/api/pom.xml b/api/pom.xml
index 2851cfdf..fc018c0d 100644
--- a/api/pom.xml
+++ b/api/pom.xml
@@ -21,7 +21,7 @@
jakarta.enterprisejakarta.enterprise.cdi-parent
- 4.1.0-M1
+ 4.1.0-SNAPSHOTjakarta.enterprise.cdi-api
@@ -217,7 +217,7 @@
scm:git:git@github.com:cdi-spec/cdi.gitscm:git:git@github.com:cdi-spec/cdi.gitscm:git:git@github.com:cdi-spec/cdi.git
- 4.1.0-M1
+ HEAD
diff --git a/el/pom.xml b/el/pom.xml
index 205a96b2..89d31555 100644
--- a/el/pom.xml
+++ b/el/pom.xml
@@ -4,7 +4,7 @@
jakarta.enterprisejakarta.enterprise.cdi-parent
- 4.1.0-M1
+ 4.1.0-SNAPSHOTjakarta.enterprise.cdi-el-api
diff --git a/lang-model/pom.xml b/lang-model/pom.xml
index 86ea050a..dc905c86 100644
--- a/lang-model/pom.xml
+++ b/lang-model/pom.xml
@@ -4,7 +4,7 @@
jakarta.enterprisejakarta.enterprise.cdi-parent
- 4.1.0-M1
+ 4.1.0-SNAPSHOTjakarta.enterprise.lang-model
diff --git a/pom.xml b/pom.xml
index 259da341..f09700c8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,7 +10,7 @@
jakarta.enterprisejakarta.enterprise.cdi-parentpom
- 4.1.0-M1
+ 4.1.0-SNAPSHOTParent module for CDI Specification
@@ -26,7 +26,7 @@
scm:git:git://github.com/eclipse-ee4j/cdi.gitscm:git:git@github.com:eclipse-ee4j/cdi.githttps://github.com/eclipse-ee4j/cdi
- 4.1.0-M1
+ HEAD
diff --git a/spec/pom.xml b/spec/pom.xml
index 485c5c52..a00c29e2 100644
--- a/spec/pom.xml
+++ b/spec/pom.xml
@@ -4,7 +4,7 @@
jakarta.enterprisejakarta.enterprise.cdi-parent
- 4.1.0-M1
+ 4.1.0-SNAPSHOTjakarta.enterprise.cdi-spec-doc
From e8639b11576c4322b6d760f0d1b8a76a9bd0f827 Mon Sep 17 00:00:00 2001
From: Matej Novotny
Date: Mon, 13 Nov 2023 20:07:27 +0100
Subject: [PATCH 054/113] Add an API for programmatic access to assignability
rules for observer methods and typesafe resolution.
---
.../enterprise/inject/spi/BeanContainer.java | 36 +++++++++++++++++++
.../asciidoc/core/beanmanager_lite.asciidoc | 11 ++++++
2 files changed, 47 insertions(+)
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 cf6b0bdc..97b3cf32 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/BeanContainer.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/BeanContainer.java
@@ -251,4 +251,40 @@ public interface BeanContainer {
* @since 2.0
*/
Instanceclean package
+
+
+
+ net.revelc.code.formatter
+ formatter-maven-plugin
+ ${formatter.version}
+
+
+ jakarta.enterprise
+ cdi-ide-config
+ ${project.version}
+
+
+
+
+ .cache/formatter-maven-plugin-${formatter-maven-plugin.version}
+ cdi-format.xml
+ LF
+ ${format.skip}
+
+
+
+ net.revelc.code
+ impsort-maven-plugin
+ ${impsort.version}
+
+
+ .cache/impsort-maven-plugin-${impsort-maven-plugin.version}
+ java.,javax.,jakarta.,org.,com.
+ *
+ ${format.skip}
+ true
+
+
+
+
@@ -48,6 +85,11 @@
3.8.13.2.2
+
+ false
+ 2.23.0
+ 1.9.0
+
https://jakarta.oss.sonatype.org/${sonatypeOssDistMgmtNexusUrl}content/repositories/staging/
@@ -86,6 +128,91 @@
+
+
+ format
+
+ false
+
+ !no-format
+
+
+
+
+ src/main/java
+
+
+
+
+
+ net.revelc.code.formatter
+ formatter-maven-plugin
+
+
+ process-sources
+
+ format
+
+
+
+
+
+ net.revelc.code
+ impsort-maven-plugin
+
+
+ sort-imports
+
+ sort
+
+
+
+
+
+
+
+
+ validate
+
+ false
+
+ no-format
+
+
+
+
+ src/main/java
+
+
+
+
+
+ net.revelc.code.formatter
+ formatter-maven-plugin
+
+
+ process-sources
+
+ validate
+
+
+
+
+
+ net.revelc.code
+ impsort-maven-plugin
+
+
+ check-imports
+
+ check
+
+
+
+
+
+
+
From 48aa4dc6ce701fdfc614fe4eef4e8414fc596bba Mon Sep 17 00:00:00 2001
From: Matej Novotny
Date: Sat, 9 Dec 2023 21:23:04 +0100
Subject: [PATCH 059/113] Apply formatting rules to the codebase
---
.../java/jakarta/decorator/Decorator.java | 12 +-
.../main/java/jakarta/decorator/Delegate.java | 48 ++---
.../java/jakarta/decorator/package-info.java | 149 ++++++++------
.../enterprise/context/ApplicationScoped.java | 25 +--
.../enterprise/context/BeforeDestroyed.java | 13 +-
.../context/BusyConversationException.java | 12 +-
.../enterprise/context/ContextException.java | 4 +-
.../context/ContextNotActiveException.java | 6 +-
.../enterprise/context/Conversation.java | 32 +--
.../context/ConversationScoped.java | 30 ++-
.../jakarta/enterprise/context/Dependent.java | 11 +-
.../jakarta/enterprise/context/Destroyed.java | 1 +
.../enterprise/context/Initialized.java | 11 +-
.../NonexistentConversationException.java | 12 +-
.../enterprise/context/NormalScope.java | 10 +-
.../enterprise/context/RequestScoped.java | 12 +-
.../enterprise/context/SessionScoped.java | 13 +-
.../control/ActivateRequestContext.java | 13 +-
.../control/RequestContextController.java | 51 ++---
.../enterprise/context/package-info.java | 179 +++++++++--------
.../context/spi/AlterableContext.java | 12 +-
.../enterprise/context/spi/Context.java | 22 +--
.../enterprise/context/spi/Contextual.java | 10 +-
.../context/spi/CreationalContext.java | 6 +-
.../enterprise/context/spi/package-info.java | 31 +--
.../java/jakarta/enterprise/event/Event.java | 68 ++++---
.../event/ImmutableNotificationOptions.java | 4 +-
.../enterprise/event/NotificationOptions.java | 16 +-
.../enterprise/event/ObserverException.java | 4 +-
.../jakarta/enterprise/event/Observes.java | 30 +--
.../enterprise/event/ObservesAsync.java | 30 +--
.../jakarta/enterprise/event/Reception.java | 8 +-
.../enterprise/event/TransactionPhase.java | 13 +-
.../enterprise/event/package-info.java | 173 +++++++++-------
.../enterprise/inject/Alternative.java | 3 +-
.../inject/AmbiguousResolutionException.java | 4 +-
.../enterprise/inject/CreationException.java | 4 +-
.../jakarta/enterprise/inject/Decorated.java | 14 +-
.../jakarta/enterprise/inject/Disposes.java | 40 ++--
.../inject/IllegalProductException.java | 2 +-
.../enterprise/inject/InjectionException.java | 4 +-
.../jakarta/enterprise/inject/Instance.java | 86 ++++----
.../enterprise/inject/Intercepted.java | 14 +-
.../java/jakarta/enterprise/inject/Model.java | 4 +-
.../jakarta/enterprise/inject/Produces.java | 48 ++---
.../inject/ResolutionException.java | 4 +-
.../enterprise/inject/Specializes.java | 36 ++--
.../jakarta/enterprise/inject/Stereotype.java | 39 ++--
.../enterprise/inject/TransientReference.java | 17 +-
.../java/jakarta/enterprise/inject/Typed.java | 2 +-
.../UnproxyableResolutionException.java | 4 +-
.../UnsatisfiedResolutionException.java | 4 +-
.../jakarta/enterprise/inject/Vetoed.java | 10 +-
.../compatible/spi/AnnotationBuilder.java | 6 +-
.../spi/AnnotationBuilderFactory.java | 4 +-
.../inject/build/compatible/spi/BeanInfo.java | 3 +-
.../build/compatible/spi/ClassConfig.java | 6 +-
.../compatible/spi/DeclarationConfig.java | 6 +-
.../build/compatible/spi/FieldConfig.java | 6 +-
.../compatible/spi/InjectionPointInfo.java | 3 +-
.../build/compatible/spi/InterceptorInfo.java | 4 +-
.../build/compatible/spi/MetaAnnotations.java | 10 +-
.../build/compatible/spi/MethodConfig.java | 6 +-
.../build/compatible/spi/ObserverInfo.java | 7 +-
.../build/compatible/spi/ParameterConfig.java | 6 +-
.../build/compatible/spi/Parameters.java | 6 +-
.../build/compatible/spi/ScannedClasses.java | 2 +-
.../build/compatible/spi/SecurityActions.java | 3 +-
.../spi/SkipIfPortableExtensionPresent.java | 4 +-
.../build/compatible/spi/StereotypeInfo.java | 5 +-
.../compatible/spi/SyntheticBeanBuilder.java | 4 +-
.../compatible/spi/SyntheticComponents.java | 1 +
.../spi/SyntheticObserverBuilder.java | 4 +-
.../inject/build/compatible/spi/Types.java | 11 +-
.../build/compatible/spi/package-info.java | 4 +-
.../enterprise/inject/se/SeContainer.java | 12 +-
.../inject/se/SeContainerInitializer.java | 64 +++---
.../inject/spi/AfterBeanDiscovery.java | 25 +--
.../inject/spi/AfterDeploymentValidation.java | 8 +-
.../inject/spi/AfterTypeDiscovery.java | 24 ++-
.../enterprise/inject/spi/Annotated.java | 21 +-
.../inject/spi/AnnotatedCallable.java | 8 +-
.../inject/spi/AnnotatedConstructor.java | 15 +-
.../enterprise/inject/spi/AnnotatedField.java | 15 +-
.../inject/spi/AnnotatedMember.java | 12 +-
.../inject/spi/AnnotatedMethod.java | 15 +-
.../inject/spi/AnnotatedParameter.java | 17 +-
.../enterprise/inject/spi/AnnotatedType.java | 21 +-
.../jakarta/enterprise/inject/spi/Bean.java | 9 +-
.../enterprise/inject/spi/BeanAttributes.java | 14 +-
.../enterprise/inject/spi/BeanContainer.java | 83 ++++----
.../enterprise/inject/spi/BeanManager.java | 123 ++++++------
.../inject/spi/BeforeBeanDiscovery.java | 59 +++---
.../enterprise/inject/spi/BeforeShutdown.java | 6 +-
.../jakarta/enterprise/inject/spi/CDI.java | 12 +-
.../enterprise/inject/spi/CDIProvider.java | 7 +-
.../enterprise/inject/spi/Decorator.java | 14 +-
.../inject/spi/DefinitionException.java | 10 +-
.../inject/spi/DeploymentException.java | 12 +-
.../enterprise/inject/spi/EventContext.java | 8 +-
.../enterprise/inject/spi/EventMetadata.java | 10 +-
.../enterprise/inject/spi/Extension.java | 16 +-
.../enterprise/inject/spi/InjectionPoint.java | 36 ++--
.../inject/spi/InjectionTarget.java | 22 ++-
.../inject/spi/InjectionTargetFactory.java | 29 +--
.../inject/spi/InterceptionFactory.java | 8 +-
.../inject/spi/InterceptionType.java | 6 +-
.../enterprise/inject/spi/Interceptor.java | 12 +-
.../enterprise/inject/spi/ObserverMethod.java | 39 ++--
.../inject/spi/PassivationCapable.java | 12 +-
.../enterprise/inject/spi/Prioritized.java | 2 +-
.../inject/spi/ProcessAnnotatedType.java | 19 +-
.../enterprise/inject/spi/ProcessBean.java | 19 +-
.../inject/spi/ProcessBeanAttributes.java | 28 ++-
.../inject/spi/ProcessInjectionPoint.java | 16 +-
.../inject/spi/ProcessInjectionTarget.java | 16 +-
.../inject/spi/ProcessManagedBean.java | 8 +-
.../inject/spi/ProcessObserverMethod.java | 28 +--
.../inject/spi/ProcessProducer.java | 22 ++-
.../inject/spi/ProcessProducerField.java | 12 +-
.../inject/spi/ProcessProducerMethod.java | 10 +-
.../inject/spi/ProcessSessionBean.java | 16 +-
.../spi/ProcessSyntheticAnnotatedType.java | 10 +-
.../inject/spi/ProcessSyntheticBean.java | 8 +-
.../spi/ProcessSyntheticObserverMethod.java | 11 +-
.../enterprise/inject/spi/Producer.java | 20 +-
.../inject/spi/ProducerFactory.java | 16 +-
.../inject/spi/SecurityActions.java | 3 +-
.../inject/spi/SessionBeanType.java | 6 +-
.../enterprise/inject/spi/Unmanaged.java | 27 +--
.../inject/spi/WithAnnotations.java | 14 +-
.../AnnotatedConstructorConfigurator.java | 26 +--
.../AnnotatedFieldConfigurator.java | 26 +--
.../AnnotatedMethodConfigurator.java | 24 +--
.../AnnotatedParameterConfigurator.java | 28 +--
.../AnnotatedTypeConfigurator.java | 32 +--
.../BeanAttributesConfigurator.java | 11 +-
.../spi/configurator/BeanConfigurator.java | 4 +-
.../InjectionPointConfigurator.java | 9 +-
.../ObserverMethodConfigurator.java | 12 +-
.../configurator/ProducerConfigurator.java | 11 +-
.../enterprise/inject/spi/package-info.java | 187 ++++++++++--------
.../jakarta/enterprise/invoke/Invoker.java | 8 +-
.../enterprise/invoke/InvokerBuilder.java | 19 +-
.../enterprise/util/AnnotationLiteral.java | 14 +-
.../jakarta/enterprise/util/Nonbinding.java | 3 +-
.../enterprise/util/SecurityActions.java | 7 +-
.../jakarta/enterprise/util/TypeLiteral.java | 14 +-
.../jakarta/enterprise/util/package-info.java | 2 +-
.../cdi/api/test/AnnotationLiteralTest.java | 12 +-
.../java/org/jboss/cdi/api/test/CDITest.java | 21 +-
.../cdi/api/test/ClosableCDIProvider.java | 8 +-
.../jboss/cdi/api/test/DummyCDIProvider.java | 3 +-
.../jboss/cdi/api/test/DummyCDIProvider2.java | 4 +-
.../test/annotated/AbstractAnnotatedTest.java | 17 +-
.../annotated/AnnotatedCallableHolder.java | 36 ++--
.../annotated/AnnotatedConstructorHolder.java | 6 +-
.../annotated/AnnotatedConstructorTest.java | 20 +-
.../test/annotated/AnnotatedFieldHolder.java | 6 +-
.../test/annotated/AnnotatedFieldTest.java | 19 +-
.../test/annotated/AnnotatedMemberHolder.java | 29 ++-
.../test/annotated/AnnotatedMethodHolder.java | 8 +-
.../test/annotated/AnnotatedMethodTest.java | 21 +-
.../annotated/AnnotatedParameterHolder.java | 26 ++-
.../annotated/AnnotatedParameterTest.java | 18 +-
.../test/annotated/AnnotatedTypeHolder.java | 34 ++--
.../api/test/annotated/AnnotatedTypeTest.java | 14 +-
.../cdi/api/test/annotated/RepeatBean.java | 1 +
.../cdi/api/test/annotated/Repeater.java | 2 +-
.../cdi/api/test/annotated/Repeaters.java | 2 +-
.../parameter/AnnotatedParameterTest.java | 6 +-
.../test/event/NotificationOptionsTest.java | 2 +-
.../test/privileged/CDIPrivilegedTest.java | 1 -
.../api/test/privileged/FakeCDIProvider.java | 4 +-
.../annotation/AnnotationLiteralTest.java | 1 +
.../privileged/annotation/MyAnnotation.java | 2 +-
.../annotation/MyAnnotationLiteral.java | 1 -
.../test/se/DummySeContainerInitializer.java | 9 +-
.../test/se/DummySeContainerInitializer2.java | 8 +-
.../test/se/SeContainerInitializerTest.java | 14 +-
.../inject/spi/el/ELAwareBeanManager.java | 3 +-
.../enterprise/lang/model/AnnotationInfo.java | 7 +-
.../lang/model/AnnotationMember.java | 4 +-
.../lang/model/AnnotationTarget.java | 9 +-
.../lang/model/declarations/ClassInfo.java | 6 +-
.../lang/model/declarations/MethodInfo.java | 5 +-
.../lang/model/types/ParameterizedType.java | 3 +-
.../enterprise/lang/model/types/Type.java | 3 +-
188 files changed, 1941 insertions(+), 1527 deletions(-)
diff --git a/api/src/main/java/jakarta/decorator/Decorator.java b/api/src/main/java/jakarta/decorator/Decorator.java
index 3b3578ac..e7497f71 100644
--- a/api/src/main/java/jakarta/decorator/Decorator.java
+++ b/api/src/main/java/jakarta/decorator/Decorator.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -29,19 +29,21 @@
*
* Specifies that a class is a decorator. May be applied to a managed bean class.
*
* Decorators of a session bean must comply with the bean provider programming restrictions defined by the EJB specification.
* Decorators of a stateful session bean must comply with the rules for instance passivation and conversational state defined by
* the EJB specification.
*
*
- *
CDI Lite implementations are not required to provide support for decorators.
+ *
+ * CDI Lite implementations are not required to provide support for decorators.
+ *
*
* @see Delegate @Delegate identifies the delegate injection point of a decorator.
*
diff --git a/api/src/main/java/jakarta/decorator/Delegate.java b/api/src/main/java/jakarta/decorator/Delegate.java
index 23e331a7..4e757389 100644
--- a/api/src/main/java/jakarta/decorator/Delegate.java
+++ b/api/src/main/java/jakarta/decorator/Delegate.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -29,45 +29,45 @@
* Identifies the delegate injection point of a decorator. May be applied to a field, bean constructor parameter or initializer
* method parameter of a decorator bean class.
*
* A decorator must have exactly one delegate injection point. The delegate injection point must be an injected field,
* initializer method parameter or bean constructor method parameter.
*
- *
+ *
*
* The container injects a delegate object to the delegate injection point. The delegate object implements the delegate type and
* delegates method invocations along the decorator stack. When the container calls a decorator during business method
* interception, the decorator may invoke any method of the delegate object. If a decorator invokes the delegate object at any
* other time, the invoked method throws an {@link java.lang.IllegalStateException}.
*
CDI Lite implementations are not required to provide support for decorators.
+ *
+ * CDI Lite implementations are not required to provide support for decorators.
+ *
*
* @see Decorator @Decorator specifies that a class is a decorator.
- *
+ *
* @author Gavin King
* @author Pete Muir
*/
diff --git a/api/src/main/java/jakarta/decorator/package-info.java b/api/src/main/java/jakarta/decorator/package-info.java
index 4610ed95..14bf3a78 100644
--- a/api/src/main/java/jakarta/decorator/package-info.java
+++ b/api/src/main/java/jakarta/decorator/package-info.java
@@ -8,89 +8,114 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
- *
Annotations relating to decorators.
- *
- *
A decorator implements one or more bean types and
- * intercepts business method invocations of
- * {@linkplain jakarta.enterprise.inject beans} which
- * implement those bean types. These bean types are called
- * decorated types.
- *
- *
A decorator is a managed bean annotated {@link
- * jakarta.decorator.Decorator @Decorator}.
- *
- *
Decorators are superficially similar to interceptors,
- * but because they directly implement operations with business
- * semantics, they are able to implement business logic and,
- * conversely, unable to implement the cross-cutting concerns
- * for which interceptors are optimized. Decorators are called
- * after interceptors.
- *
+ *
+ * Annotations relating to decorators.
+ *
+ *
+ *
+ * A decorator implements one or more bean types and
+ * intercepts business method invocations of
+ * {@linkplain jakarta.enterprise.inject beans} which
+ * implement those bean types. These bean types are called
+ * decorated types.
+ *
+ *
+ *
+ * A decorator is a managed bean annotated {@link
+ * jakarta.decorator.Decorator @Decorator}.
+ *
+ *
+ *
+ * Decorators are superficially similar to interceptors,
+ * but because they directly implement operations with business
+ * semantics, they are able to implement business logic and,
+ * conversely, unable to implement the cross-cutting concerns
+ * for which interceptors are optimized. Decorators are called
+ * after interceptors.
+ *
+ *
*
Decorated types
- *
- *
The set of decorated types of a decorator includes all
- * bean types of the managed bean that are Java interfaces,
- * except for {@link java.io.Serializable}. The decorator bean
- * class and its superclasses are not decorated types of the
- * decorator. The decorator class may be abstract.
- *
- *
A decorator intercepts every method:
+ *
+ *
+ * The set of decorated types of a decorator includes all
+ * bean types of the managed bean that are Java interfaces,
+ * except for {@link java.io.Serializable}. The decorator bean
+ * class and its superclasses are not decorated types of the
+ * decorator. The decorator class may be abstract.
+ *
+ *
+ *
+ * A decorator intercepts every method:
+ *
*
*
declared by a decorated type of the decorator
*
that is implemented by the bean class of the decorator.
*
- *
- *
A decorator may be an abstract class, and is not required to
- * implement every method of every decorated type.
- *
+ *
+ *
+ * A decorator may be an abstract class, and is not required to
+ * implement every method of every decorated type.
+ *
+ *
*
Delegate injection points
- *
- *
All decorators have a
- * {@linkplain jakarta.decorator.Delegate delegate injection point}.
- * A delegate injection point is an injection point of the bean
- * class annotated {@link jakarta.decorator.Delegate @Delegate}.
- *
- *
The type of the delegate injection point must implement or
- * extend every decorated type. A decorator is not required to
- * implement the type of the delegate injection point.
- *
+ *
+ *
+ * All decorators have a
+ * {@linkplain jakarta.decorator.Delegate delegate injection point}.
+ * A delegate injection point is an injection point of the bean
+ * class annotated {@link jakarta.decorator.Delegate @Delegate}.
+ *
+ *
+ *
+ * The type of the delegate injection point must implement or
+ * extend every decorated type. A decorator is not required to
+ * implement the type of the delegate injection point.
+ *
+ *
*
Enabled decorators
- *
- *
By default, a bean archive has no enabled decorators. A
- * decorator must be explicitly enabled by listing its bean class
+ *
+ *
+ * By default, a bean archive has no enabled decorators. A
+ * decorator must be explicitly enabled by listing its bean class
* under the <decorators> element of the
* beans.xml file of the bean archive. The order of the
- * decorator declarations determines the decorator ordering.
- * Decorators which occur earlier in the list are called first.
- *
- *
A decorator is bound to a bean if:
- *
+ * decorator declarations determines the decorator ordering.
+ * Decorators which occur earlier in the list are called first.
+ *
+ *
+ *
+ * A decorator is bound to a bean if:
+ *
+ *
*
- *
The bean is {@linkplain jakarta.enterprise.inject eligible for injection}
+ *
The bean is {@linkplain jakarta.enterprise.inject eligible for injection}
* to the delegate injection point of the decorator.
*
The decorator is enabled in the bean archive of the bean.
*
- *
- *
If a managed bean class is declared final, it may not have
- * decorators. If a managed bean has a non-static, non-private,
+ *
+ *
+ * If a managed bean class is declared final, it may not have
+ * decorators. If a managed bean has a non-static, non-private,
* final method, it may not have any decorator which implements
- * that method.
- *
- *
A decorator instance is a
- * {@linkplain jakarta.enterprise.context.Dependent dependent object}
- * of the object it decorates.
- *
+ * that method.
+ *
+ *
+ *
+ * A decorator instance is a
+ * {@linkplain jakarta.enterprise.context.Dependent dependent object}
+ * of the object it decorates.
+ *
* While ApplicationScoped must be associated with the built-in application context required by the specification,
* third-party extensions are
- * allowed to also associate it with their own context. Behavior described below is only related to the built-in application context.
+ * allowed to also associate it with their own context. Behavior described below is only related to the built-in application
+ * context.
*
*
*
@@ -43,7 +44,8 @@
*
*
*
- *
during the service() method of any servlet in the web application, during the doFilter() method of any
+ *
during the service() method of any servlet in the web application, during the doFilter() method
+ * of any
* servlet filter and when the container calls any ServletContextListener, HttpSessionListener,
* AsyncListener or ServletRequestListener,
*
during any Java EE web service invocation,
@@ -64,15 +66,16 @@
*
*
*
- * An event with qualifier @Initialized(ApplicationScoped.class) is fired when the application context is initialized
- * and an event with qualifier @Destroyed(ApplicationScoped.class) when the application context is destroyed.
- * The event payload is:
- *
- *
- *
- *
the ServletContext if the application is a web application deployed to a Servlet container, or
- *
any java.lang.Object for other types of application.
- *
+ * An event with qualifier @Initialized(ApplicationScoped.class) is fired when the application context is
+ * initialized
+ * and an event with qualifier @Destroyed(ApplicationScoped.class) when the application context is destroyed.
+ * The event payload is:
+ *
+ *
+ *
+ *
the ServletContext if the application is a web application deployed to a Servlet container, or
+ *
any java.lang.Object for other types of application.
+ *
*
* @author Gavin King
* @author Pete Muir
diff --git a/api/src/main/java/jakarta/enterprise/context/BeforeDestroyed.java b/api/src/main/java/jakarta/enterprise/context/BeforeDestroyed.java
index 8390ecd0..b8c47612 100644
--- a/api/src/main/java/jakarta/enterprise/context/BeforeDestroyed.java
+++ b/api/src/main/java/jakarta/enterprise/context/BeforeDestroyed.java
@@ -31,7 +31,7 @@
import jakarta.inject.Qualifier;
/**
- * An event with this qualifier is fired when a context is about to be destroyed, i.e. before the actual destruction.
+ * An event with this qualifier is fired when a context is about to be destroyed, i.e. before the actual destruction.
*
* @author Pete Muir
* @author Martin Kouba
@@ -47,6 +47,7 @@
/**
* The scope for which to observe destruction
+ *
* @return the scope type class
*/
Class extends Annotation> value();
@@ -56,14 +57,14 @@
*/
public final static class Literal extends AnnotationLiteral implements BeforeDestroyed {
- public static final Literal REQUEST = of(RequestScoped.class);
-
+ public static final Literal REQUEST = of(RequestScoped.class);
+
public static final Literal CONVERSATION = of(ConversationScoped.class);
-
+
public static final Literal SESSION = of(SessionScoped.class);
-
+
public static final Literal APPLICATION = of(ApplicationScoped.class);
-
+
private static final long serialVersionUID = 1L;
private final Class extends Annotation> value;
diff --git a/api/src/main/java/jakarta/enterprise/context/BusyConversationException.java b/api/src/main/java/jakarta/enterprise/context/BusyConversationException.java
index 32611730..4fd40c4d 100644
--- a/api/src/main/java/jakarta/enterprise/context/BusyConversationException.java
+++ b/api/src/main/java/jakarta/enterprise/context/BusyConversationException.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -21,7 +21,7 @@
* Indicates that the container has rejected a request because a concurrent request is associated with the same conversation
* context.
*
- *
+ *
*
* The container ensures that a long-running conversation may be associated with at most one request at a time, by blocking or
* rejecting concurrent requests. If the container rejects a request, it must associate the request with a new transient
@@ -29,10 +29,12 @@
* lifecycle.
*
*
- *
CDI Lite implementations are not required to provide support for conversations.
- *
+ *
+ * CDI Lite implementations are not required to provide support for conversations.
+ *
+ *
* @see ConversationScoped
- *
+ *
* @author Pete Muir
* @author Gavin King
*/
diff --git a/api/src/main/java/jakarta/enterprise/context/ContextException.java b/api/src/main/java/jakarta/enterprise/context/ContextException.java
index 220a1727..3371d84f 100644
--- a/api/src/main/java/jakarta/enterprise/context/ContextException.java
+++ b/api/src/main/java/jakarta/enterprise/context/ContextException.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -20,7 +20,7 @@
*
* Indicates a problem relating to context management.
*
- *
+ *
* @author Pete Muir
* @author Shane Bryzak
*/
diff --git a/api/src/main/java/jakarta/enterprise/context/ContextNotActiveException.java b/api/src/main/java/jakarta/enterprise/context/ContextNotActiveException.java
index 8ef81400..7153f2e2 100644
--- a/api/src/main/java/jakarta/enterprise/context/ContextNotActiveException.java
+++ b/api/src/main/java/jakarta/enterprise/context/ContextNotActiveException.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -22,9 +22,9 @@
*
* Indicates that a context is not active.
*
- *
+ *
* @see Context
- *
+ *
* @author Pete Muir
* @author Shane Bryzak
* @author Gavin King
diff --git a/api/src/main/java/jakarta/enterprise/context/Conversation.java b/api/src/main/java/jakarta/enterprise/context/Conversation.java
index 4d5b7ebf..77b95089 100644
--- a/api/src/main/java/jakarta/enterprise/context/Conversation.java
+++ b/api/src/main/java/jakarta/enterprise/context/Conversation.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -21,28 +21,30 @@
* the current conversation as transient or long-running, specifying a conversation identifier, or setting the conversation
* timeout.
*
- *
+ *
*
* An instance may be injected:
*
- *
+ *
*
* @Inject
* Conversation conversation;
*
- *
+ *
*
* The conversation timeout is a hint to the container that a conversation should not be destroyed if it has been active within
* the last given interval in milliseconds.
*
*
- *
CDI Lite implementations are not required to provide support for conversations.
- *
+ *
+ * CDI Lite implementations are not required to provide support for conversations.
+ *
+ *
* @see ConversationScoped @ConversationScoped
- *
+ *
* @author Pete Muir
* @author Gavin King
- *
+ *
*/
public interface Conversation {
@@ -50,7 +52,7 @@ public interface Conversation {
*
* Mark the current transient conversation long-running. A conversation identifier is generated by the container.
*
- *
+ *
* @throws IllegalStateException if the current conversation is already marked long-running.
*/
public void begin();
@@ -59,7 +61,7 @@ public interface Conversation {
*
* Mark the current transient conversation long-running, with a specified identifier.
*
- *
+ *
* @param id conversation id
* @throws IllegalStateException if the current conversation is already marked long-running.
* @throws IllegalArgumentException if a conversation with the specified identifier already exists.
@@ -70,7 +72,7 @@ public interface Conversation {
*
* Marks the current long-running conversation transient.
*
- *
+ *
* @throws IllegalStateException if the current conversation is already marked transient.
*/
public void end();
@@ -79,7 +81,7 @@ public interface Conversation {
*
* Get the identifier of the current long-running conversation.
*
- *
+ *
* @return the identifier of the current long-running conversation, or a null value if the current conversation is
* transient.
*/
@@ -89,7 +91,7 @@ public interface Conversation {
*
* Get the timeout of the current conversation.
*
- *
+ *
* @return the current timeout in milliseconds.
*/
public long getTimeout();
@@ -98,7 +100,7 @@ public interface Conversation {
*
* Set the timeout of the current conversation.
*
- *
+ *
* @param milliseconds the new timeout in milliseconds.
*/
public void setTimeout(long milliseconds);
@@ -107,7 +109,7 @@ public interface Conversation {
*
* Determine if the conversation is marked transient or long-running.
*
- *
+ *
* @return true if the conversation is marked transient, or falseif it is marked long-running.
*/
public boolean isTransient();
diff --git a/api/src/main/java/jakarta/enterprise/context/ConversationScoped.java b/api/src/main/java/jakarta/enterprise/context/ConversationScoped.java
index a3c30e2e..6770be1d 100644
--- a/api/src/main/java/jakarta/enterprise/context/ConversationScoped.java
+++ b/api/src/main/java/jakarta/enterprise/context/ConversationScoped.java
@@ -32,10 +32,12 @@
*
* Specifies that a bean is conversation scoped.
*
- *
- * While ConversationScoped must be associated with the built-in conversation context required by the specification,
+ *
+ * While ConversationScoped must be associated with the built-in conversation context required by the
+ * specification,
* third-party extensions are
- * allowed to also associate it with their own context. Behavior described below is only related to the built-in conversation context.
+ * allowed to also associate it with their own context. Behavior described below is only related to the built-in conversation
+ * context.
*
*
* The conversation scope is active:
@@ -44,12 +46,14 @@
*
during all Servlet requests.
*
*
- * An event with qualifier @Initialized(ConversationScoped.class) is fired when the conversation context is initialized
+ * An event with qualifier @Initialized(ConversationScoped.class) is fired when the conversation context is
+ * initialized
* and an event with qualifier @Destroyed(ConversationScoped.class) is fired when the conversation is destroyed.
* The event payload is:
*
*
- *
the conversation id if the conversation context is destroyed and is not associated with a current Servlet request, or
+ *
the conversation id if the conversation context is destroyed and is not associated with a current Servlet request,
+ * or
*
the ServletRequest if the application is a web application deployed to a Servlet container, or
*
any java.lang.Object for other types of application.
*
@@ -63,8 +67,10 @@
*
Any Servlet request has exactly one associated conversation.
*
The container provides a filter with the name "CDI Conversation Filter", which may be mapped in web.xml,
* allowing the user alter when the conversation is associated with the servlet request. If this filter is not mapped in any
- * web.xml in the application, the conversation associated with a Servlet request is determined at the beginning of the
- * request before calling any service() method of any servlet in the web application, calling the doFilter()
+ * web.xml in the application, the conversation associated with a Servlet request is determined at the beginning of
+ * the
+ * request before calling any service() method of any servlet in the web application, calling the
+ * doFilter()
* method of any servlet filter in the web application and before the container calls any ServletRequestListener or
* AsyncListener in the web application.
*
@@ -106,13 +112,15 @@
*
The long-running conversation context associated with a request that renders a JSF view is automatically propagated to
* any faces request (JSF form submission) that originates from that rendered page.
*
The long-running conversation context associated with a request that results in a JSF redirect (a redirect resulting from
- * a navigation rule or JSF NavigationHandler) is automatically propagated to the resulting non-faces request, and to any other
+ * a navigation rule or JSF NavigationHandler) is automatically propagated to the resulting non-faces request, and
+ * to any other
* subsequent request to the same URL. This is accomplished via use of a request parameter named cid containing the
* unique identifier of the conversation.
*
*
*
- * When no conversation is propagated to a Servlet request, or if a request parameter named conversationPropagation has
+ * When no conversation is propagated to a Servlet request, or if a request parameter named conversationPropagation
+ * has
* the value none the request is associated with a new transient conversation.
* All long-running conversations are scoped to a particular HTTP servlet session and may not cross session boundaries.
* In the following cases, a propagated long-running conversation cannot be restored and re-associated with the request:
@@ -125,7 +133,9 @@
* Servlet request, in order to conserve resources.
*
*
- *
CDI Lite implementations are not required to provide support for conversations.
+ *
+ * CDI Lite implementations are not required to provide support for conversations.
+ *
* Specifies that a bean belongs to the dependent pseudo-scope.
@@ -73,13 +72,15 @@
*
*
*
- * Many instances of beans with scope @Dependent belong to some other bean or Java EE component class instance and are
+ * Many instances of beans with scope @Dependent belong to some other bean or Java EE component class instance and
+ * are
* called dependent objects.
*
*
*
*
Instances of decorators and interceptors are dependent objects of the bean instance they decorate.
- *
An instance of a bean with scope @Dependent injected into a field, bean constructor or initializer method is a
+ *
An instance of a bean with scope @Dependent injected into a field, bean constructor or initializer method is
+ * a
* dependent object of the bean or Java EE component class instance into which it was injected.
*
An instance of a bean with scope @Dependent injected into a producer method is a dependent object of the
* producer method bean instance that is being produced.
diff --git a/api/src/main/java/jakarta/enterprise/context/Destroyed.java b/api/src/main/java/jakarta/enterprise/context/Destroyed.java
index 760c878c..8d733786 100644
--- a/api/src/main/java/jakarta/enterprise/context/Destroyed.java
+++ b/api/src/main/java/jakarta/enterprise/context/Destroyed.java
@@ -46,6 +46,7 @@
/**
* The scope for which to observe destruction
+ *
* @return the scope type class
*/
Class extends Annotation> value();
diff --git a/api/src/main/java/jakarta/enterprise/context/Initialized.java b/api/src/main/java/jakarta/enterprise/context/Initialized.java
index 49b2035e..9e8549c5 100644
--- a/api/src/main/java/jakarta/enterprise/context/Initialized.java
+++ b/api/src/main/java/jakarta/enterprise/context/Initialized.java
@@ -46,6 +46,7 @@
/**
* The scope for which to observe initialization
+ *
* @return the scope type class
*/
Class extends Annotation> value();
@@ -56,13 +57,13 @@
* @author Martin Kouba
*/
public final static class Literal extends AnnotationLiteral implements Initialized {
-
- public static final Literal REQUEST = of(RequestScoped.class);
-
+
+ public static final Literal REQUEST = of(RequestScoped.class);
+
public static final Literal CONVERSATION = of(ConversationScoped.class);
-
+
public static final Literal SESSION = of(SessionScoped.class);
-
+
public static final Literal APPLICATION = of(ApplicationScoped.class);
private static final long serialVersionUID = 1L;
diff --git a/api/src/main/java/jakarta/enterprise/context/NonexistentConversationException.java b/api/src/main/java/jakarta/enterprise/context/NonexistentConversationException.java
index 9c4b7c14..7a8bf2d8 100644
--- a/api/src/main/java/jakarta/enterprise/context/NonexistentConversationException.java
+++ b/api/src/main/java/jakarta/enterprise/context/NonexistentConversationException.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -20,16 +20,18 @@
*
* Indicates that the conversation context could not be restored.
*
- *
+ *
*
* If the propagated conversation cannot be restored, the container must associate the request with a new transient conversation
* and throw an exception of type NonexistentConversationException.
*
*
- *
CDI Lite implementations are not required to provide support for conversations.
- *
+ *
+ * CDI Lite implementations are not required to provide support for conversations.
+ *
+ *
* @see ConversationScoped
- *
+ *
* @author Pete Muir
* @author Gavin King
*/
diff --git a/api/src/main/java/jakarta/enterprise/context/NormalScope.java b/api/src/main/java/jakarta/enterprise/context/NormalScope.java
index fae6ceb6..484d04da 100644
--- a/api/src/main/java/jakarta/enterprise/context/NormalScope.java
+++ b/api/src/main/java/jakarta/enterprise/context/NormalScope.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -27,10 +27,10 @@
*
* Specifies that an annotation type is a normal scope type.
*
- *
+ *
* @author Gavin King
* @author Pete Muir
- *
+ *
* @see jakarta.inject.Scope @Scope is used to declare pseudo-scopes.
*/
@Target(ANNOTATION_TYPE)
@@ -42,12 +42,12 @@
*
* Determines whether the normal scope type is a passivating scope.
*
- *
+ *
*
* A bean is called passivation capable if the container is able to temporarily transfer the state of any idle instance to
* secondary storage. A passivating scope requires that beans with the scope are passivation capable.
*
- *
+ *
* @return true if the scope type is a passivating scope type
*/
boolean passivating() default false;
diff --git a/api/src/main/java/jakarta/enterprise/context/RequestScoped.java b/api/src/main/java/jakarta/enterprise/context/RequestScoped.java
index c6af80f8..0b3aac64 100644
--- a/api/src/main/java/jakarta/enterprise/context/RequestScoped.java
+++ b/api/src/main/java/jakarta/enterprise/context/RequestScoped.java
@@ -35,7 +35,8 @@
*
* While RequestScoped must be associated with the built-in request context required by the specification,
* third-party extensions are
- * allowed to also associate it with their own context. Behavior described below is only related to the built-in request context.
+ * allowed to also associate it with their own context. Behavior described below is only related to the built-in request
+ * context.
*
*
*
@@ -43,7 +44,8 @@
*
*
*
- *
during the service() method of any servlet in the web application, during the doFilter() method of any
+ *
during the service() method of any servlet in the web application, during the doFilter() method
+ * of any
* servlet filter and when the container calls any ServletRequestListener or AsyncListener,
*
during any Java EE web service invocation,
*
during any remote method invocation of any EJB, during any asynchronous method invocation of any EJB, during any call to
@@ -61,12 +63,14 @@
*
after the web service invocation completes,
*
after the EJB remote method invocation, asynchronous method invocation, timeout or message delivery completes if it
* did not already exist when the invocation occurred, or
- *
after the @PostConstruct callback completes, if it did not already exist when the @PostConstruct
+ *
after the @PostConstruct callback completes, if it did not already exist when the
+ * @PostConstruct
* callback occurred.
*
*
*
- * An event with qualifier @Initialized(RequestScoped.class) is fired when the request context is initialized and an
+ * An event with qualifier @Initialized(RequestScoped.class) is fired when the request context is initialized and
+ * an
* event
* with qualifier @Destroyed(RequestScoped.class) when the request context is destroyed. The event payload is:
*
* While SessionScoped must be associated with the built-in session context required by the specification,
* third-party extensions are
- * allowed to also associate it with their own context. Behavior described below is only related to the built-in session context.
+ * allowed to also associate it with their own context. Behavior described below is only related to the built-in session
+ * context.
*
*
* The session scope is active:
@@ -58,17 +59,21 @@
*
*
when the HTTPSession times out, after all HttpSessionListeners have been called, or
*
at the very end of
- * any request in which invalidate() was called, after all filters and ServletRequestListeners have been
+ * any request in which invalidate() was called, after all filters and ServletRequestListeners have
+ * been
* called.
*
*
*
- * An event with qualifier @Initialized(SessionScoped.class) is fired when the session context is initialized and an
+ * An event with qualifier @Initialized(SessionScoped.class) is fired when the session context is initialized and
+ * an
* event
* with qualifier @Destroyed(SessionScoped.class) when the session context is destroyed. The event payload is
* the HttpSession
*
- *
CDI Lite implementations are not required to provide support for the session scope.
+ *
+ * CDI Lite implementations are not required to provide support for the session scope.
+ *
*
* @author Gavin King
* @author Pete Muir
diff --git a/api/src/main/java/jakarta/enterprise/context/control/ActivateRequestContext.java b/api/src/main/java/jakarta/enterprise/context/control/ActivateRequestContext.java
index 4227019d..6e291fe7 100644
--- a/api/src/main/java/jakarta/enterprise/context/control/ActivateRequestContext.java
+++ b/api/src/main/java/jakarta/enterprise/context/control/ActivateRequestContext.java
@@ -16,28 +16,29 @@
package jakarta.enterprise.context.control;
-import jakarta.interceptor.InterceptorBinding;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import jakarta.interceptor.InterceptorBinding;
/**
* The container provides a built in interceptor that may be used to annotate classes and methods to indicate
* that a request context should be activated when this method is invoked.
*
* The request context will be activated before the method is called, and deactivated when the method invocation is
- * complete (regardless of any exceptions being thrown). If the context is already active, it is ignored, neither
+ * complete (regardless of any exceptions being thrown). If the context is already active, it is ignored, neither
* activated nor deactivated.
*
* @since 2.0
* @author John D. Ament
*/
@InterceptorBinding
-@Target({METHOD, TYPE})
+@Target({ METHOD, TYPE })
@Retention(RUNTIME)
@Documented
public @interface ActivateRequestContext {
diff --git a/api/src/main/java/jakarta/enterprise/context/control/RequestContextController.java b/api/src/main/java/jakarta/enterprise/context/control/RequestContextController.java
index da269fce..0a6b3772 100644
--- a/api/src/main/java/jakarta/enterprise/context/control/RequestContextController.java
+++ b/api/src/main/java/jakarta/enterprise/context/control/RequestContextController.java
@@ -20,21 +20,21 @@
/**
* The CDI container provides a built in instance of RequestContextController that is dependent scoped for the purposes
- * of activating and deactivating. For example:
+ * of activating and deactivating. For example:
*
*
- * @Inject
- * private RequestContextController requestContextController;
+ * @Inject
+ * private RequestContextController requestContextController;
*
- * public void doRequest(String body) {
- * // activate request context
- * requestContextController.activate();
+ * public void doRequest(String body) {
+ * // activate request context
+ * requestContextController.activate();
*
- * // do work in a request context.
+ * // do work in a request context.
*
- * // deactivate the request context
- * requestContextController.deactivate();
- * }
+ * // deactivate the request context
+ * requestContextController.deactivate();
+ * }
*
*
* Once the request context has been deactivated, you may activate it once again, creating a brand new request context.
@@ -46,20 +46,21 @@
*/
public interface RequestContextController {
- /**
- * Activates a RequestContext for the current thread if one is not already active.
- * @return true if the context was activated by this invocation, false if not.
- */
- boolean activate();
+ /**
+ * Activates a RequestContext for the current thread if one is not already active.
+ *
+ * @return true if the context was activated by this invocation, false if not.
+ */
+ boolean activate();
- /**
- * Deactivates the current Request Context if it was activated by this context controller. If the context is active
- * but was not activated by this controller, then it may not be deactivated by this controller,
- * meaning this method will do nothing.
- *
- * If the context is not active, a {@linkplain ContextNotActiveException} is thrown.
- *
- * @throws ContextNotActiveException if the context is not active
- */
- void deactivate() throws ContextNotActiveException;
+ /**
+ * Deactivates the current Request Context if it was activated by this context controller. If the context is active
+ * but was not activated by this controller, then it may not be deactivated by this controller,
+ * meaning this method will do nothing.
+ *
+ * If the context is not active, a {@linkplain ContextNotActiveException} is thrown.
+ *
+ * @throws ContextNotActiveException if the context is not active
+ */
+ void deactivate() throws ContextNotActiveException;
}
diff --git a/api/src/main/java/jakarta/enterprise/context/package-info.java b/api/src/main/java/jakarta/enterprise/context/package-info.java
index 86e701e4..2cf1d32f 100644
--- a/api/src/main/java/jakarta/enterprise/context/package-info.java
+++ b/api/src/main/java/jakarta/enterprise/context/package-info.java
@@ -8,122 +8,147 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
- *
Annotations and interfaces relating to scopes and contexts.
- *
- *
A scope type is a Java annotation annotated
- * {@link jakarta.inject.Scope @Scope} or
+ *
+ * Annotations and interfaces relating to scopes and contexts.
+ *
+ *
+ *
+ * A scope type is a Java annotation annotated
+ * {@link jakarta.inject.Scope @Scope} or
* {@link jakarta.enterprise.context.NormalScope @NormalScope}.
* The scope of a bean determines the lifecycle and visibility of
- * its instances. In particular, the scope determines:
- *
+ * its instances. In particular, the scope determines:
+ *
+ *
*
*
When a new instance of the bean is created
*
When an existing instance of the bean is destroyed
*
Which injected references refer to any instance of the
* bean
*
- *
+ *
*
Built-in scopes
- *
- *
The following built-in scopes are provided:
+ *
+ *
The container provides an implementation of the Context
- * interface for each of the built-in scopes. The built-in request,
- * session, and application contexts support servlet, web service
+ * {@link jakarta.inject.Singleton @Singleton}.
+ *
+ *
+ *
+ * The container provides an implementation of the Context
+ * interface for each of the built-in scopes. The built-in request,
+ * session, and application contexts support servlet, web service
* and EJB invocations. The built-in conversation context supports
- * JSF requests.
- *
- *
For other kinds of invocations, a portable extension may define a
- * custom {@linkplain jakarta.enterprise.context.spi.Context context object}
- * for any or all of the built-in scopes. For example, a third-party web
- * application framework might provide a conversation context object for
- * the built-in conversation scope.
- *
- *
The context associated with a built-in scope propagates across
- * local, synchronous Java method calls, including invocation of EJB
- * local business methods. The context does not propagate across remote
- * method invocations or to asynchronous processes such as JMS message
- * listeners or EJB timer service timeouts.
- *
+ * JSF requests.
+ *
+ *
+ *
+ * For other kinds of invocations, a portable extension may define a
+ * custom {@linkplain jakarta.enterprise.context.spi.Context context object}
+ * for any or all of the built-in scopes. For example, a third-party web
+ * application framework might provide a conversation context object for
+ * the built-in conversation scope.
+ *
+ *
+ *
+ * The context associated with a built-in scope propagates across
+ * local, synchronous Java method calls, including invocation of EJB
+ * local business methods. The context does not propagate across remote
+ * method invocations or to asynchronous processes such as JMS message
+ * listeners or EJB timer service timeouts.
+ *
+ *
*
Normal scopes and pseudo-scopes
- *
- *
Most scopes are normal scopes. Normal scopes are declared
- * using {@link jakarta.enterprise.context.NormalScope @NormalScope}.
- * If a bean has a normal scope, every client executing in a certain
- * thread sees the same contextual instance of the bean. This instance is
- * called the current instance of the bean. The operation
+ *
+ *
+ * Most scopes are normal scopes. Normal scopes are declared
+ * using {@link jakarta.enterprise.context.NormalScope @NormalScope}.
+ * If a bean has a normal scope, every client executing in a certain
+ * thread sees the same contextual instance of the bean. This instance is
+ * called the current instance of the bean. The operation
* {@link jakarta.enterprise.context.spi.Context#get(Contextual)} of the
- * context object for a normal scope type always returns the current
- * instance of the given bean.
+ * context object for a normal scope type always returns the current
+ * instance of the given bean.
+ *
*
- *
Any scope that is not a normal scope is called a pseudo-scope.
- * Pseudo-scopes are declared using {@link jakarta.inject.Scope @Scope}.
- * The concept of a current instance is not well-defined in the case of
+ *
+ * Any scope that is not a normal scope is called a pseudo-scope.
+ * Pseudo-scopes are declared using {@link jakarta.inject.Scope @Scope}.
+ * The concept of a current instance is not well-defined in the case of
* a pseudo-scope. Different clients executing in the same thread may
* see different instances of the bean. In the extreme case of the
* {@link jakarta.enterprise.context.Dependent @Dependent} pseudo-scope,
- * every client has its own private instance of the bean.
- *
- *
All built-in scopes are normal scopes, except for the
+ * every client has its own private instance of the bean.
+ *
+ *
+ *
+ * All built-in scopes are normal scopes, except for the
* {@link jakarta.enterprise.context.Dependent @Dependent} and
- * {@link jakarta.inject.Singleton @Singleton} pseudo-scopes.
A reference to a bean obtained from the container via {@linkplain
- * jakarta.enterprise.inject.Instance programmatic lookup} is called a
- * contextual reference. A contextual reference for a bean with a normal
- * scope refers to the current instance of the bean. A contextual
- * reference for a bean are valid only for a certain period of time. The
- * application should not invoke a method of an invalid reference.
- *
- *
The validity of a contextual reference for a bean depends upon
- * whether the scope of the bean is a normal scope or a pseudo-scope:
- *
+ *
+ *
+ * A reference to a bean obtained from the container via {@linkplain
+ * jakarta.enterprise.inject.Instance programmatic lookup} is called a
+ * contextual reference. A contextual reference for a bean with a normal
+ * scope refers to the current instance of the bean. A contextual
+ * reference for a bean are valid only for a certain period of time. The
+ * application should not invoke a method of an invalid reference.
+ *
+ *
+ *
+ * The validity of a contextual reference for a bean depends upon
+ * whether the scope of the bean is a normal scope or a pseudo-scope:
+ *
+ *
*
- *
Any reference to a bean with a normal scope is valid as long as
- * the application maintains a hard reference to it. However, it may
- * only be invoked when the context associated with the normal scope is
- * active. If it is invoked when the context is inactive, a
- * {@link jakarta.enterprise.context.ContextNotActiveException} is thrown
+ *
Any reference to a bean with a normal scope is valid as long as
+ * the application maintains a hard reference to it. However, it may
+ * only be invoked when the context associated with the normal scope is
+ * active. If it is invoked when the context is inactive, a
+ * {@link jakarta.enterprise.context.ContextNotActiveException} is thrown
* by the container.
- *
Any reference to a bean with a pseudo-scope is valid until the
- * bean instance to which it refers is destroyed. It may be invoked
- * even if the context associated with the pseudo-scope is not active.
- * If the application invokes a method of a reference to an instance
+ *
Any reference to a bean with a pseudo-scope is valid until the
+ * bean instance to which it refers is destroyed. It may be invoked
+ * even if the context associated with the pseudo-scope is not active.
+ * If the application invokes a method of a reference to an instance
* that has already been destroyed, the behavior is undefined.
*
- *
- *
A reference to a bean obtained from the container via {@linkplain
+ *
+ *
+ * A reference to a bean obtained from the container via {@linkplain
* jakarta.inject.Inject dependency injection} is a special kind of
* contextual reference, called an injected reference. Additional
- * restrictions apply to the validity of an injected reference:
- *
+ * restrictions apply to the validity of an injected reference:
+ *
+ *
*
- *
A reference to a bean injected into a field, bean constructor or
- * initializer method is only valid until the object into which it was
+ *
A reference to a bean injected into a field, bean constructor or
+ * initializer method is only valid until the object into which it was
* injected is destroyed.
- *
A reference to a bean injected into a producer method is only
- * valid until the producer method bean instance that is being produced
- * is destroyed.
- *
A reference to a bean injected into a disposer method or observer
+ *
A reference to a bean injected into a producer method is only
+ * valid until the producer method bean instance that is being produced
+ * is destroyed.
+ *
+ *
A reference to a bean injected into a disposer method or observer
* method is only valid until the invocation of the method completes.
*
- *
+ *
* @see jakarta.enterprise.inject
- *
+ *
*/
package jakarta.enterprise.context;
diff --git a/api/src/main/java/jakarta/enterprise/context/spi/AlterableContext.java b/api/src/main/java/jakarta/enterprise/context/spi/AlterableContext.java
index 02e16257..e92d331a 100644
--- a/api/src/main/java/jakarta/enterprise/context/spi/AlterableContext.java
+++ b/api/src/main/java/jakarta/enterprise/context/spi/AlterableContext.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -24,12 +24,12 @@
* Provides an operation for obtaining and destroying contextual instances with a particular scope of any contextual type. Any
* instance of {@code Context} is called a context object.
*
- *
+ *
*
* {@link AlterableContext} was introduced in CDI 1.1 to allow bean instances to be destroyed by the application. Extensions
* should implement {@link AlterableContext} instead of {@link Context}.
*
- *
+ *
*
* The context object is responsible for creating and destroying contextual instances by calling operations of
* {@link Contextual}. In particular, the context object is responsible for destroying any
@@ -39,12 +39,12 @@
* {@link CreationalContext} to {@code Contextual.destroy()} that it passed to
* {@code Contextual.create()} when it created the instance.
*
- *
+ *
*
* A custom context object may be registered with the container using
* {@link AfterBeanDiscovery#addContext(Context)}.
*
* Destroy the existing contextual instance. If there is no existing instance, no action is taken.
*
- *
+ *
* @param contextual the contextual type
* @throws ContextNotActiveException if the context is not active
*/
diff --git a/api/src/main/java/jakarta/enterprise/context/spi/Context.java b/api/src/main/java/jakarta/enterprise/context/spi/Context.java
index 5e996d8c..a1154c8a 100644
--- a/api/src/main/java/jakarta/enterprise/context/spi/Context.java
+++ b/api/src/main/java/jakarta/enterprise/context/spi/Context.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -26,12 +26,12 @@
* Provides an operation for obtaining contextual instances with a particular scope of any contextual type. Any instance of
* {@code Context} is called a context object.
*
- *
+ *
*
* {@link AlterableContext} was introduced in CDI 1.1 to allow bean instances to be destroyed by the application. Extensions
* should implement {@link AlterableContext} instead of {@link Context}.
*
- *
+ *
*
* The context object is responsible for creating and destroying contextual instances by calling operations of
* {@link Contextual}. In particular, the context object is responsible for destroying any
@@ -41,12 +41,12 @@
* {@link CreationalContext} to {@code Contextual.destroy()} that it passed to
* {@code Contextual.create()} when it created the instance.
*
- *
+ *
*
* A custom context object may be registered with the container using
* {@link AfterBeanDiscovery#addContext(Context)}.
*
- *
+ *
* @author Gavin King
* @author Pete Muir
*/
@@ -55,7 +55,7 @@ public interface Context {
/**
* Get the scope type of the context object.
- *
+ *
* @return the scope
*/
public Class extends Annotation> getScope();
@@ -63,30 +63,30 @@ public interface Context {
/**
* Return an existing instance of certain contextual type or create a new instance by calling
* {@link Contextual#create(CreationalContext)} and return the new instance.
- *
+ *
* @param the type of contextual type
* @param contextual the contextual type
* @param creationalContext the context in which the new instance will be created
* @return the contextual instance
- *
+ *
* @throws ContextNotActiveException if the context is not active
*/
public T get(Contextual contextual, CreationalContext creationalContext);
/**
* Return an existing instance of a certain contextual type or a null value.
- *
+ *
* @param the type of the contextual type
* @param contextual the contextual type
* @return the contextual instance, or a null value
- *
+ *
* @throws ContextNotActiveException if the context is not active
*/
public T get(Contextual contextual);
/**
* Determines if the context object is active.
- *
+ *
* @return true if the context is active, or false otherwise.
*/
public boolean isActive();
diff --git a/api/src/main/java/jakarta/enterprise/context/spi/Contextual.java b/api/src/main/java/jakarta/enterprise/context/spi/Contextual.java
index 96eda883..022f96c4 100644
--- a/api/src/main/java/jakarta/enterprise/context/spi/Contextual.java
+++ b/api/src/main/java/jakarta/enterprise/context/spi/Contextual.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -24,9 +24,9 @@
* Defines operations to create and destroy contextual instances of a certain type. Any implementation of {@code Contextual} is
* called a contextual type. In particular, all beans are contextual types.
*
- *
+ *
* @see Bean
- *
+ *
* @author Gavin King
* @author Nicklas Karlsson
* @author Pete Muir
@@ -39,7 +39,7 @@ public interface Contextual {
* that any dependent objects are associated with the contextual instance that is being created. An implementation may call
* {@link CreationalContext#push(Object)} between instantiation and injection to help the
* container minimize the use of client proxy objects.
- *
+ *
* @param creationalContext the context in which this instance is being created
* @return the contextual instance
* @throws CreationException if a checked exception occurs while creating the instance
@@ -50,7 +50,7 @@ public interface Contextual {
* Destroy an instance of the contextual type. Implementations should call
* {@link CreationalContext#release()} to allow the container to destroy dependent objects of
* the contextual instance.
- *
+ *
* @param instance the contextual instance to destroy
* @param creationalContext the context in which this instance was created
*/
diff --git a/api/src/main/java/jakarta/enterprise/context/spi/CreationalContext.java b/api/src/main/java/jakarta/enterprise/context/spi/CreationalContext.java
index 9b73ae78..51d8672e 100644
--- a/api/src/main/java/jakarta/enterprise/context/spi/CreationalContext.java
+++ b/api/src/main/java/jakarta/enterprise/context/spi/CreationalContext.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -20,7 +20,7 @@
* Provides operations that are used by the {@link Contextual} implementation during instance
* creation and destruction.
*
- *
+ *
* @author Gavin King
* @author Pete Muir
*
@@ -32,7 +32,7 @@ public interface CreationalContext {
* Registers an incompletely initialized contextual instance the with the container. A contextual instance is considered
* incompletely initialized until it is returned by
* {@link Contextual#create(CreationalContext)} .
- *
+ *
* @param incompleteInstance the incompletely initialized instance
*/
public void push(T incompleteInstance);
diff --git a/api/src/main/java/jakarta/enterprise/context/spi/package-info.java b/api/src/main/java/jakarta/enterprise/context/spi/package-info.java
index 4d385b66..dd97f21a 100644
--- a/api/src/main/java/jakarta/enterprise/context/spi/package-info.java
+++ b/api/src/main/java/jakarta/enterprise/context/spi/package-info.java
@@ -8,26 +8,31 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
- *
The custom context SPI.
- *
- *
Associated with every
- * {@linkplain jakarta.enterprise.context scope type} is a
+ *
+ * The custom context SPI.
+ *
+ *
+ *
+ * Associated with every
+ * {@linkplain jakarta.enterprise.context scope type} is a
* {@linkplain jakarta.enterprise.context.spi.Context context object}.
- * The context object implements the semantics of the scope type.
- *
- *
The context implementation collaborates with the container via
- * the {@link jakarta.enterprise.context.spi.Context Context} and
- * {@link jakarta.enterprise.context.spi.Contextual Contextual}
- * interfaces to create and destroy contextual instances.
- *
+ * The context object implements the semantics of the scope type.
+ *
+ *
+ *
+ * The context implementation collaborates with the container via
+ * the {@link jakarta.enterprise.context.spi.Context Context} and
+ * {@link jakarta.enterprise.context.spi.Contextual Contextual}
+ * interfaces to create and destroy contextual instances.
+ *
+ *
* @see jakarta.enterprise.context
* @see jakarta.enterprise.inject.spi
*/
package jakarta.enterprise.context.spi;
-
diff --git a/api/src/main/java/jakarta/enterprise/event/Event.java b/api/src/main/java/jakarta/enterprise/event/Event.java
index a5abbe72..69be79a3 100644
--- a/api/src/main/java/jakarta/enterprise/event/Event.java
+++ b/api/src/main/java/jakarta/enterprise/event/Event.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -20,74 +20,75 @@
import java.util.concurrent.CompletionStage;
import java.util.concurrent.Executor;
-import jakarta.enterprise.util.TypeLiteral;
import jakarta.enterprise.inject.Any;
+import jakarta.enterprise.util.TypeLiteral;
/**
*
* Allows the application to fire events of a particular type.
*
- *
+ *
*
* Beans fire events via an instance of the Event interface, which may be injected:
*
the specified type is the type parameter specified at the injection point, and
*
the specified qualifiers are the qualifiers specified at the injection point.
*
- *
+ *
*
- * Events may also be fired asynchronously with {@link #fireAsync(Object)} and {@link #fireAsync(Object, NotificationOptions)} methods
+ * Events may also be fired asynchronously with {@link #fireAsync(Object)} and {@link #fireAsync(Object, NotificationOptions)}
+ * methods
*
- *
+ *
* @author Gavin King
* @author Pete Muir
* @author David Allen
* @author Antoine Sabot-Durand
- *
+ *
* @param the type of the event object
*/
@@ -97,7 +98,7 @@ public interface Event {
*
* Fires an event with the specified qualifiers and notifies observers.
*
- *
+ *
* @param event the event object
* @throws IllegalArgumentException if the runtime type of the event object contains a type variable
* @throws ObserverException if a notified observer throws a checked exception, it will be wrapped and rethrown as an
@@ -115,9 +116,11 @@ public interface Event {
* @return a {@link CompletionStage} allowing further pipeline composition on the asynchronous operation.
* Default asynchronous execution facility is container specific.
* If any observer notified by this event throws an exception
- * then the resulting CompletionStage is completed exceptionally with {@link java.util.concurrent.CompletionException}
+ * then the resulting CompletionStage is completed exceptionally with
+ * {@link java.util.concurrent.CompletionException}
* that wraps all the exceptions raised by observers as suppressed exception.
- * If no exception is thrown by observers then the resulting CompletionStage is completed normally with the event payload.
+ * If no exception is thrown by observers then the resulting CompletionStage is completed normally with the event
+ * payload.
* @throws IllegalArgumentException if the runtime type of the event object contains a type variable
*
* @since 2.0
@@ -127,7 +130,7 @@ public interface Event {
/**
*
* Fires an event asynchronously with the specified qualifiers and notifies asynchronous observers.
- * A custom {@link Executor} will be used to make asynchronous calls
+ * A custom {@link Executor} will be used to make asynchronous calls
*
*
* @param event type
@@ -136,23 +139,26 @@ public interface Event {
* @return a {@link CompletionStage} allowing further pipeline composition on the asynchronous operation.
* Default asynchronous execution facility is container specific.
* If any observer notified by this event throws an exception
- * then the resulting CompletionStage is completed exceptionally with {@link java.util.concurrent.CompletionException}
+ * then the resulting CompletionStage is completed exceptionally with
+ * {@link java.util.concurrent.CompletionException}
* that wraps all the exceptions raised by observers as suppressed exception.
- * If no exception is thrown by observers then the resulting CompletionStage is completed normally with the event payload.
+ * If no exception is thrown by observers then the resulting CompletionStage is completed normally with the event
+ * payload.
* @throws IllegalArgumentException if the runtime type of the event object contains a type variable
*
* @since 2.0
*/
- public CompletionStage fireAsync(U event, NotificationOptions options);
+ public CompletionStage fireAsync(U event, NotificationOptions options);
/**
*
* Obtains a child Event for the given additional required qualifiers.
*
- *
+ *
* @param qualifiers the additional specified qualifiers
* @return the child Event
- * @throws IllegalArgumentException if passed two instances of the same non repeating qualifier type, or an instance of an annotation that
+ * @throws IllegalArgumentException if passed two instances of the same non repeating qualifier type, or an instance of an
+ * annotation that
* is not a qualifier type
*/
public Event select(Annotation... qualifiers);
@@ -161,12 +167,13 @@ public interface Event {
*
* Obtains a child Event for the given required type and additional required qualifiers.
*
- *
+ *
* @param the specified type
* @param subtype a {@link java.lang.Class} representing the specified type
* @param qualifiers the additional specified qualifiers
* @return the child Event
- * @throws IllegalArgumentException if passed two instances of the same non repeating qualifier type, or an instance of an annotation that
+ * @throws IllegalArgumentException if passed two instances of the same non repeating qualifier type, or an instance of an
+ * annotation that
* is not a qualifier type
*/
public Event select(Class subtype, Annotation... qualifiers);
@@ -175,12 +182,13 @@ public interface Event {
*
* Obtains a child Event for the given required type and additional required qualifiers.
*
- *
+ *
* @param the specified type
* @param subtype a {@link TypeLiteral} representing the specified type
* @param qualifiers the additional specified qualifiers
* @return the child Event
- * @throws IllegalArgumentException if passed two instances of the same non repeating qualifier type, or an instance of an annotation that
+ * @throws IllegalArgumentException if passed two instances of the same non repeating qualifier type, or an instance of an
+ * annotation that
* is not a qualifier type
*/
public Event select(TypeLiteral subtype, Annotation... qualifiers);
diff --git a/api/src/main/java/jakarta/enterprise/event/ImmutableNotificationOptions.java b/api/src/main/java/jakarta/enterprise/event/ImmutableNotificationOptions.java
index 4e23a10c..0a681962 100644
--- a/api/src/main/java/jakarta/enterprise/event/ImmutableNotificationOptions.java
+++ b/api/src/main/java/jakarta/enterprise/event/ImmutableNotificationOptions.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -21,7 +21,7 @@
/**
* The immutable implementation of {@link NotificationOptions}.
- *
+ *
* @author Martin Kouba
*
*/
diff --git a/api/src/main/java/jakarta/enterprise/event/NotificationOptions.java b/api/src/main/java/jakarta/enterprise/event/NotificationOptions.java
index 8621779d..df63794c 100644
--- a/api/src/main/java/jakarta/enterprise/event/NotificationOptions.java
+++ b/api/src/main/java/jakarta/enterprise/event/NotificationOptions.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -19,7 +19,7 @@
/**
* Notification options are used to configure observer notification.
- *
+ *
* @author Martin Kouba
* @see Event#fireAsync(Object, NotificationOptions)
* @since 2.0
@@ -27,20 +27,20 @@
public interface NotificationOptions {
/**
- *
+ *
* @return the executor used to execute an asynchronous event
*/
Executor getExecutor();
/**
- *
+ *
* @param optionName name of the option to get value of
* @return the value of an option or null if no option for the given name exists
*/
Object get(String optionName);
/**
- *
+ *
* @param executor a specific {@link Executor} to handle observer notification
* @return an immutable holder of an executor
*/
@@ -49,7 +49,7 @@ static NotificationOptions ofExecutor(Executor executor) {
}
/**
- *
+ *
* @param optionName name of the option to set
* @param optionValue value for the option
* @return an immutable holder of a single option
@@ -59,7 +59,7 @@ static NotificationOptions of(String optionName, Object optionValue) {
}
/**
- *
+ *
* @return the options builder
*/
static Builder builder() {
@@ -68,7 +68,7 @@ static Builder builder() {
/**
* Notification options builder.
- *
+ *
* @author Martin Kouba
* @since 2.0
*/
diff --git a/api/src/main/java/jakarta/enterprise/event/ObserverException.java b/api/src/main/java/jakarta/enterprise/event/ObserverException.java
index a491ba4c..d6ec19f5 100644
--- a/api/src/main/java/jakarta/enterprise/event/ObserverException.java
+++ b/api/src/main/java/jakarta/enterprise/event/ObserverException.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -20,7 +20,7 @@
*
* Indicates that a checked exception was thrown by an observer method during event notification.
*
- *
+ *
* @author Pete Muir
* @author Gavin King
*/
diff --git a/api/src/main/java/jakarta/enterprise/event/Observes.java b/api/src/main/java/jakarta/enterprise/event/Observes.java
index c1d9ea4c..a297007d 100644
--- a/api/src/main/java/jakarta/enterprise/event/Observes.java
+++ b/api/src/main/java/jakarta/enterprise/event/Observes.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -30,52 +30,52 @@
* Identifies the event parameter of an observer method. May be applied to a parameter of a method of a bean class or
* {@linkplain Extension extension}.
*
- *
+ *
*
* public void afterLogin(@Observes LoggedInEvent event) { ... }
*
- *
+ *
*
* An observer method is a non-abstract method of a managed bean class or session bean class (or of an extension). An observer
* method may be either static or non-static. If the bean is a session bean, the observer method must be either a business
* method of the EJB or a static method of the bean class.
*
- *
+ *
*
* Each observer method must have exactly one event parameter, of the same type as the event type it observes. Event qualifiers
* may be declared by annotating the event parameter. When searching for observer methods for an event, the container considers
* the type and qualifiers of the event parameter.
*
- *
+ *
*
* If the event parameter does not explicitly declare any qualifier, the observer method observes events with no qualifier.
*
- *
+ *
*
* The event parameter type may contain a type variable or wildcard.
*
- *
+ *
*
* In addition to the event parameter, observer methods may declare additional parameters, which may declare qualifiers. These
* additional parameters are injection points.
*
- *
+ *
*
* public void afterLogin(@Observes LoggedInEvent event, @Manager User user, Logger log) { ... }
*
- *
+ *
*
* A bean (or extension) may declare multiple observer methods.
*
- *
+ *
*
* Observer methods are inherited by bean subclasses.
*
- *
+ *
*
* Interceptors and decorators may not declare observer methods.
*
- *
+ *
* @author Gavin King
* @author Pete Muir
* @author David Allen
@@ -89,11 +89,12 @@
*
* Specifies {@linkplain Reception under what conditions the observer method is notified}.
*
- *
+ *
*
* By default, the observer method is notified even if no instance of the bean that defines the observer method already
* exists in the current context.
*
+ *
* @return conditional observer type
*/
public Reception notifyObserver() default Reception.ALWAYS;
@@ -102,10 +103,11 @@
*
* Specifies {@linkplain Reception at what time the observer method is notified}.
*
- *
+ *
*
* By default, the observer method is notified when the event is fired.
*
+ *
* @return phase of the transaction
*/
public TransactionPhase during() default TransactionPhase.IN_PROGRESS;
diff --git a/api/src/main/java/jakarta/enterprise/event/ObservesAsync.java b/api/src/main/java/jakarta/enterprise/event/ObservesAsync.java
index 00a7e6e3..17cb3033 100644
--- a/api/src/main/java/jakarta/enterprise/event/ObservesAsync.java
+++ b/api/src/main/java/jakarta/enterprise/event/ObservesAsync.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -25,54 +25,54 @@
/**
*
- * Identifies the event parameter of an asynchronous observer method. May be applied to a parameter of a method of a bean class
+ * Identifies the event parameter of an asynchronous observer method. May be applied to a parameter of a method of a bean class
*
- *
+ *
*
* public void afterLogin(@ObservesAsync LoggedInEvent event) { ... }
*
- *
+ *
*
* An observer method is a non-abstract method of a managed bean class or session bean class (or of an extension). An observer
* method may be either static or non-static. If the bean is a session bean, the observer method must be either a business
* method of the EJB or a static method of the bean class.
*
- *
+ *
*
* Each observer method must have exactly one event parameter, of the same type as the event type it observes. Event qualifiers
* may be declared by annotating the event parameter. When searching for observer methods for an event, the container considers
* the type and qualifiers of the event parameter.
*
- *
+ *
*
* If the event parameter does not explicitly declare any qualifier, the observer method observes events with no qualifier.
*
- *
+ *
*
* The event parameter type may contain a type variable or wildcard.
*
- *
+ *
*
* In addition to the event parameter, observer methods may declare additional parameters, which may declare qualifiers. These
* additional parameters are injection points.
*
- *
+ *
*
* public void afterLogin(@ObservesAsync LoggedInEvent event, @Manager User user, Logger log) { ... }
*
- *
+ *
*
* A bean (or extension) may declare multiple observer methods.
*
- *
+ *
*
* Observer methods are inherited by bean subclasses.
*
- *
+ *
*
* Interceptors and decorators may not declare observer methods.
*
- *
+ *
* @author Gavin King
* @author Pete Muir
* @author David Allen
@@ -86,14 +86,14 @@
*
* Specifies {@linkplain Reception under what conditions the observer method is notified}.
*
- *
+ *
*
* By default, the observer method is notified even if no instance of the bean that defines the observer method already
* exists in the current context.
*
+ *
* @return conditional observer type
*/
public Reception notifyObserver() default Reception.ALWAYS;
-
}
diff --git a/api/src/main/java/jakarta/enterprise/event/Reception.java b/api/src/main/java/jakarta/enterprise/event/Reception.java
index 7a277406..eccc89cf 100644
--- a/api/src/main/java/jakarta/enterprise/event/Reception.java
+++ b/api/src/main/java/jakarta/enterprise/event/Reception.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -22,16 +22,16 @@
* Distinguishes conditional {@linkplain Observes observer methods} from observer methods which are
* always notified.
*
- *
+ *
*
* A conditional observer method is an observer method which is notified of an event only if an instance of the bean that
* defines the observer method already exists in the current context.
*
- *
+ *
*
* Beans with scope {@link Dependent @Dependent} may not have conditional observer methods.
*
- *
+ *
* @author Gavin King
* @author Dan Allen
* @author David Allen
diff --git a/api/src/main/java/jakarta/enterprise/event/TransactionPhase.java b/api/src/main/java/jakarta/enterprise/event/TransactionPhase.java
index c6ca1c81..da993ee5 100644
--- a/api/src/main/java/jakarta/enterprise/event/TransactionPhase.java
+++ b/api/src/main/java/jakarta/enterprise/event/TransactionPhase.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -24,15 +24,17 @@
* Transactional observer methods are observer methods which receive event notifications during the before or after completion
* phase of the transaction in which the event was fired. If no transaction is in progress when the event is fired, they are
* notified at the same time as other observers.
- * If the transaction is in progress, but {@code jakarta.transaction.Synchronization} callback cannot be registered due to the transaction being already
- * marked for rollback or in state where {@code jakarta.transaction.Synchronization} callbacks cannot be registered, the {@link #BEFORE_COMPLETION},
+ * If the transaction is in progress, but {@code jakarta.transaction.Synchronization} callback cannot be registered due to the
+ * transaction being already
+ * marked for rollback or in state where {@code jakarta.transaction.Synchronization} callbacks cannot be registered, the
+ * {@link #BEFORE_COMPLETION},
* {@link #AFTER_COMPLETION} and {@link #AFTER_FAILURE} observer methods are notified at the same time as other observers,
* but {@link #AFTER_SUCCESS} observer methods get skipped.
*
*
* @author Pete Muir
* @author Gavin King
- *
+ *
*/
@SuppressWarnings("ALL")
public enum TransactionPhase {
@@ -74,7 +76,8 @@ public enum TransactionPhase {
* transaction fails.
*
*
- * Transactional observer will be notified will also get invoked if there is no transaction in progress, or the transaction is in progress,
+ * Transactional observer will be notified will also get invoked if there is no transaction in progress, or the transaction
+ * is in progress,
* but {@code jakarta.transaction.Synchronization} callback cannot be registered due to the transaction being already
* marked for rollback or in state where {@code jakarta.transaction.Synchronization} callbacks cannot be registered.
*
diff --git a/api/src/main/java/jakarta/enterprise/event/package-info.java b/api/src/main/java/jakarta/enterprise/event/package-info.java
index 1f0f9450..dfa2955e 100644
--- a/api/src/main/java/jakarta/enterprise/event/package-info.java
+++ b/api/src/main/java/jakarta/enterprise/event/package-info.java
@@ -8,110 +8,141 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
- *
Annotations and interfaces relating to events.
- *
- *
{@linkplain jakarta.enterprise.inject Beans} may produce and
- * consume events. Events allows beans to interact in a completely
- * decoupled fashion, with no compile-time dependency between the
- * interacting beans. Most importantly, it allows stateful beans
- * in one architectural tier of the application to synchronize
- * their internal state with state changes that occur in a
- * different tier.
- *
- *
Events may be fired synchronously or asynchronously.
- *
- *
An event comprises:
- *
+ *
+ * Annotations and interfaces relating to events.
+ *
+ *
+ *
+ * {@linkplain jakarta.enterprise.inject Beans} may produce and
+ * consume events. Events allows beans to interact in a completely
+ * decoupled fashion, with no compile-time dependency between the
+ * interacting beans. Most importantly, it allows stateful beans
+ * in one architectural tier of the application to synchronize
+ * their internal state with state changes that occur in a
+ * different tier.
+ *
+ *
+ *
+ * Events may be fired synchronously or asynchronously.
+ *
+ *
+ *
+ * An event comprises:
+ *
+ *
*
*
A Java object, called the event object
- *
A (possibly empty) set of instances of qualifier types, called
+ *
A (possibly empty) set of instances of qualifier types, called
* the event qualifiers
*
- *
- *
The {@link jakarta.enterprise.event.Event} interface is used to
- * fire events.
- *
+ *
+ *
+ * The {@link jakarta.enterprise.event.Event} interface is used to
+ * fire events.
+ *
+ *
*
Event objects and event types
- *
- *
The event object acts as a payload, to propagate state from
- * producer to consumer. An event object is an instance of a concrete
- * Java class with no type variables.
- *
- *
The event types of the event include all superclasses and
- * interfaces of the runtime class of the event object. An event type
- * may not contain a type variable.
- *
+ *
+ *
+ * The event object acts as a payload, to propagate state from
+ * producer to consumer. An event object is an instance of a concrete
+ * Java class with no type variables.
+ *
+ *
+ *
+ * The event types of the event include all superclasses and
+ * interfaces of the runtime class of the event object. An event type
+ * may not contain a type variable.
+ *
+ *
*
Event qualifiers
- *
- *
The event qualifiers act as topic selectors, allowing the consumer
+ *
+ *
+ * The event qualifiers act as topic selectors, allowing the consumer
* to narrow the set of events it observes. An event qualifier may be an
- * instance of any {@linkplain jakarta.inject.Qualifier qualifier type}.
- *
+ * instance of any {@linkplain jakarta.inject.Qualifier qualifier type}.
+ *
+ *
*
Observer methods
- *
- *
An {@linkplain jakarta.enterprise.event.Observes observer method}
+ *
+ *
+ * An {@linkplain jakarta.enterprise.event.Observes observer method}
* allows the application to receive and respond synchronously to event notifications.
- * And an {@linkplain jakarta.enterprise.event.ObservesAsync async observer method}
+ * And an {@linkplain jakarta.enterprise.event.ObservesAsync async observer method}
* allows the application to receive and respond asynchronously to event notifications.
* they both act as event consumers, observing events of a specific type, with a
- * specific set of qualifiers. Any Java type may be observed by an
- * observer method.
- *
- *
An observer method is a method of a bean class or
- * {@linkplain jakarta.enterprise.inject.spi.Extension extension} with a
+ * specific set of qualifiers. Any Java type may be observed by an
+ * observer method.
+ *
+ *
+ *
+ * An observer method is a method of a bean class or
+ * {@linkplain jakarta.enterprise.inject.spi.Extension extension} with a
* parameter annotated {@link jakarta.enterprise.event.Observes @Observes}
- * or {@link jakarta.enterprise.event.ObservesAsync @ObservesAsync}.
- *
- *
An observer method will be notified of an event if:
+ * An observer method will be notified of an event if:
+ *
+ *
*
- *
the event object is assignable to the type observed by the observer
+ *
the event object is assignable to the type observed by the observer
* method,
*
the observer method has all the event qualifiers of the event, and
- *
either the event is not a
- * {@linkplain jakarta.enterprise.inject.spi container lifecycle event}, or
- * the observer method belongs to an
+ *
either the event is not a
+ * {@linkplain jakarta.enterprise.inject.spi container lifecycle event}, or
+ * the observer method belongs to an
* {@linkplain jakarta.enterprise.inject.spi.Extension extension}.
*
- *
- *
If a synchronous observer method is a
- * {@linkplain jakarta.enterprise.event.TransactionPhase transactional
+ *
+ *
+ * If a synchronous observer method is a
+ * {@linkplain jakarta.enterprise.event.TransactionPhase transactional
* observer method} and there is a JTA transaction in progress when the
- * event is fired, the observer method is notified during the appropriate
- * transaction completion phase. Otherwise, the observer is notified when
- * the event is fired.
- *
- *
The order in which observer methods are called depends on the value of
- * the @{@linkplain jakarta.annotation.Priority Priority} applied to the observer.
- *
If no priority is defined on a observer, its priority is jakarta.interceptor.Interceptor.Priority.APPLICATION+500.
- *
If two observer have the same priority their relative order is undefined.
- *
- *
Observer methods may throw exceptions:
- *
+ * event is fired, the observer method is notified during the appropriate
+ * transaction completion phase. Otherwise, the observer is notified when
+ * the event is fired.
+ *
+ *
+ *
+ * The order in which observer methods are called depends on the value of
+ * the @{@linkplain jakarta.annotation.Priority Priority} applied to the observer.
+ *
+ *
+ * If no priority is defined on a observer, its priority is jakarta.interceptor.Interceptor.Priority.APPLICATION+500.
+ *
+ *
+ * If two observer have the same priority their relative order is undefined.
+ *
+ *
+ *
+ * Observer methods may throw exceptions:
+ *
+ *
*
- *
If the observer method is a
- * {@linkplain jakarta.enterprise.event.TransactionPhase transactional
+ *
If the observer method is a
+ * {@linkplain jakarta.enterprise.event.TransactionPhase transactional
* observer method}, any exception is caught and logged by the container.
*
If the observer method is asynchronous, any exception is caught by the container and added as a suppressed exception
* to a {@link java.util.concurrent.CompletionException} that could be handle by the application
*
Otherwise, the exception aborts processing of the event.
- * No other observer methods of that event will be called. The
- * exception is rethrown. If the exception is a checked exception,
- * it is wrapped and rethrown as an (unchecked)
+ * No other observer methods of that event will be called. The
+ * exception is rethrown. If the exception is a checked exception,
+ * it is wrapped and rethrown as an (unchecked)
* {@link jakarta.enterprise.event.ObserverException}.
* By default, a bean archive has no selected alternatives. An alternative must be explicitly declared using the
- * <alternatives> element of the beans.xml file of the bean archive. The <alternatives>
+ * <alternatives> element of the beans.xml file of the bean archive. The
+ * <alternatives>
* element contains a list of bean classes and stereotypes. An alternative is selected for the bean archive if either:
*
*
diff --git a/api/src/main/java/jakarta/enterprise/inject/AmbiguousResolutionException.java b/api/src/main/java/jakarta/enterprise/inject/AmbiguousResolutionException.java
index 50fc54e3..50e9dd47 100644
--- a/api/src/main/java/jakarta/enterprise/inject/AmbiguousResolutionException.java
+++ b/api/src/main/java/jakarta/enterprise/inject/AmbiguousResolutionException.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -20,7 +20,7 @@
* Indicates that multiple beans match a certain combination of required type and required qualifiers and are eligible for
* injection into a certain class.
*
- *
+ *
* @author Pete Muir
* @author Gavin King
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/CreationException.java b/api/src/main/java/jakarta/enterprise/inject/CreationException.java
index f1aab30f..f58a9b7c 100644
--- a/api/src/main/java/jakarta/enterprise/inject/CreationException.java
+++ b/api/src/main/java/jakarta/enterprise/inject/CreationException.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -20,7 +20,7 @@
*
* Indicates that a checked exception was thrown during creation of a bean.
*
- *
+ *
* @author Pete Muir
* @author Gavin King
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/Decorated.java b/api/src/main/java/jakarta/enterprise/inject/Decorated.java
index 0eb9cfee..6cce0b0d 100644
--- a/api/src/main/java/jakarta/enterprise/inject/Decorated.java
+++ b/api/src/main/java/jakarta/enterprise/inject/Decorated.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -30,7 +30,7 @@
*
* A decorator may inject metadata about the bean it is decorating
*
CDI Lite implementations are not required to provide support for decorators.
- *
+ *
+ * CDI Lite implementations are not required to provide support for decorators.
+ *
+ *
* @author Pete Muir
* @since 1.1
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/Disposes.java b/api/src/main/java/jakarta/enterprise/inject/Disposes.java
index 72690300..a0a1bc3d 100644
--- a/api/src/main/java/jakarta/enterprise/inject/Disposes.java
+++ b/api/src/main/java/jakarta/enterprise/inject/Disposes.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -27,54 +27,54 @@
*
* Identifies the disposed parameter of a disposer method. May be applied to a parameter of a method of a bean class.
*
* A disposer method allows the application to perform customized cleanup of an object returned by a
* {@linkplain Produces producer method or producer field}.
*
- *
+ *
*
* A disposer method must be a non-abstract method of a managed bean class or session bean class. A disposer method may be
* either static or non-static. If the bean is a session bean, the disposer method must be a business method of the EJB or a
* static method of the bean class.
*
- *
+ *
*
* A bean may declare multiple disposer methods.
*
- *
+ *
*
* Each disposer method must have exactly one disposed parameter, of the same type as the corresponding producer method or
* producer field return type. When searching for disposer methods for a producer method or producer field, the container
@@ -82,31 +82,31 @@
* producer field declared by the same bean class, the container must call this method when destroying any instance returned by
* that producer method or producer field.
*
- *
+ *
*
* In addition to the disposed parameter, a disposer method may declare additional parameters, which may also specify
* qualifiers. These additional parameters are injection points.
*
* A disposer method may resolve to multiple producer methods or producer fields declared by the bean class, in which case the
* container must call it when destroying any instance returned by any of these producer methods or producer fields.
*
- *
+ *
*
* Disposer methods are not inherited by bean subclasses.
*
- *
+ *
*
* Interceptors and decorators may not declare disposer methods.
*
- *
+ *
* @see Produces @Produces
- *
+ *
* @author Gavin King
* @author Pete Muir
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/IllegalProductException.java b/api/src/main/java/jakarta/enterprise/inject/IllegalProductException.java
index d58c2311..0b485152 100644
--- a/api/src/main/java/jakarta/enterprise/inject/IllegalProductException.java
+++ b/api/src/main/java/jakarta/enterprise/inject/IllegalProductException.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
diff --git a/api/src/main/java/jakarta/enterprise/inject/InjectionException.java b/api/src/main/java/jakarta/enterprise/inject/InjectionException.java
index 16de0936..f75c0c50 100644
--- a/api/src/main/java/jakarta/enterprise/inject/InjectionException.java
+++ b/api/src/main/java/jakarta/enterprise/inject/InjectionException.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -18,7 +18,7 @@
/**
* Indicates a problem relating to dependency injection.
- *
+ *
* @author Pete Muir
*/
public class InjectionException extends RuntimeException {
diff --git a/api/src/main/java/jakarta/enterprise/inject/Instance.java b/api/src/main/java/jakarta/enterprise/inject/Instance.java
index a29746ca..21f7ebe8 100644
--- a/api/src/main/java/jakarta/enterprise/inject/Instance.java
+++ b/api/src/main/java/jakarta/enterprise/inject/Instance.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -29,88 +29,90 @@
*
* Allows the application to dynamically obtain instances of beans with a specified combination of required type and qualifiers.
*
- *
+ *
*
* In certain situations, injection is not the most convenient way to obtain a contextual reference. For example, it may not be
* used when:
*
- *
+ *
*
*
the bean type or qualifiers vary dynamically at runtime, or
*
depending upon the deployment, there may be no bean which satisfies the type and qualifiers, or
*
we would like to iterate over all beans of a certain type.
*
- *
+ *
*
* In these situations, an instance of the Instance may be injected:
*
the required type is the type parameter specified at the injection point, and
*
the required qualifiers are the qualifiers specified at the injection point.
*
- *
+ *
*
- * The inherited {@link jakarta.inject.Provider#get()} method returns a contextual references for the unique bean that matches the
- * required type and required qualifiers and is eligible for injection into the class into which the parent Instance
+ * The inherited {@link jakarta.inject.Provider#get()} method returns a contextual references for the unique bean that matches
+ * the
+ * required type and required qualifiers and is eligible for injection into the class into which the parent
+ * Instance
* was injected, or throws an {@link UnsatisfiedResolutionException} or
* {@link AmbiguousResolutionException}.
*
* The inherited {@link java.lang.Iterable#iterator()} method returns an iterator over contextual references for beans that
* match the required type and required qualifiers and are eligible for injection into the class into which the parent
* Instance was injected.
*
- *
+ *
*
* for (PaymentProcessor pp : anyPaymentProcessor)
* pp.test();
*
- *
+ *
* @see jakarta.inject.Provider#get()
* @see java.lang.Iterable#iterator()
* @see AnnotationLiteral
* @see TypeLiteral
- *
+ *
* @author Gavin King
* @author John Ament
* @author Martin Kouba
- *
+ *
* @param the required bean type
*/
@@ -120,10 +122,11 @@ public interface Instance extends Iterable, Provider {
*
* Obtains a child Instance for the given additional required qualifiers.
*
- *
+ *
* @param qualifiers the additional required qualifiers
* @return the child Instance
- * @throws IllegalArgumentException if passed two instances of the same non repeating qualifier type, or an instance of an annotation that
+ * @throws IllegalArgumentException if passed two instances of the same non repeating qualifier type, or an instance of an
+ * annotation that
* is not a qualifier type
* @throws IllegalStateException if the container is already shutdown
*/
@@ -133,12 +136,13 @@ public interface Instance extends Iterable, Provider {
*
* Obtains a child Instance for the given required type and additional required qualifiers.
*
- *
+ *
* @param the required type
* @param subtype a {@link java.lang.Class} representing the required type
* @param qualifiers the additional required qualifiers
* @return the child Instance
- * @throws IllegalArgumentException if passed two instances of the same non repeating qualifier type, or an instance of an annotation that
+ * @throws IllegalArgumentException if passed two instances of the same non repeating qualifier type, or an instance of an
+ * annotation that
* is not a qualifier type
* @throws IllegalStateException if the container is already shutdown
*/
@@ -148,12 +152,13 @@ public interface Instance extends Iterable, Provider {
*
* Obtains a child Instance for the given required type and additional required qualifiers.
*
- *
+ *
* @param the required type
* @param subtype a {@link TypeLiteral} representing the required type
* @param qualifiers the additional required qualifiers
* @return the child Instance
- * @throws IllegalArgumentException if passed two instances of the same non repeating qualifier type, or an instance of an annotation that
+ * @throws IllegalArgumentException if passed two instances of the same non repeating qualifier type, or an instance of an
+ * annotation that
* is not a qualifier type
* @throws IllegalStateException if the container is already shutdown
*/
@@ -177,7 +182,7 @@ default Stream stream() {
* Determines if there is no bean that matches the required type and qualifiers and is eligible for injection into the class
* into which the parent Instance was injected.
*
- *
+ *
* @return true if there is no bean that matches the required type and qualifiers and is eligible for injection
* into the class into which the parent Instance was injected, or false otherwise.
*/
@@ -188,9 +193,11 @@ default Stream stream() {
* Determines if there is more than one bean that matches the required type and qualifiers and is eligible for injection
* into the class into which the parent Instance was injected.
*
- *
- * @return true if there is more than one bean that matches the required type and qualifiers and is eligible for
- * injection into the class into which the parent Instance was injected, or false otherwise.
+ *
+ * @return true if there is more than one bean that matches the required type and qualifiers and is eligible
+ * for
+ * injection into the class into which the parent Instance was injected, or false
+ * otherwise.
*/
boolean isAmbiguous();
@@ -202,7 +209,8 @@ default Stream stream() {
*
* @since 2.0
* @return true if there is exactly one bean that matches the required type and qualifiers and is eligible for
- * injection into the class into which the parent Instance was injected, or false otherwise.
+ * injection into the class into which the parent Instance was injected, or false
+ * otherwise.
*/
default boolean isResolvable() {
return !isUnsatisfied() && !isAmbiguous();
@@ -213,13 +221,13 @@ default boolean isResolvable() {
* When called, the container destroys the instance if the active context object for the scope type of the bean supports
* destroying bean instances. All normal scoped built-in contexts support destroying bean instances.
*
- *
+ *
*
* The instance passed should either be a dependent scoped bean instance obtained from the same {@link Instance} object, or
* the client proxy for a normal scoped bean instance.
*
- *
- *
+ *
+ *
* @since 1.1
* @param instance the instance to destroy
* @throws UnsupportedOperationException if the active context object for the scope type of the bean does not support
@@ -242,11 +250,13 @@ default boolean isResolvable() {
Handle getHandle();
/**
- * Allows iterating over contextual reference handles for all beans that have the required type and required qualifiers and are eligible
+ * Allows iterating over contextual reference handles for all beans that have the required type and required qualifiers and
+ * are eligible
* for injection.
*
*
- * Note that the returned {@link Iterable} is stateless. Therefore, each {@link Iterable#iterator()} produces a new set of handles.
+ * Note that the returned {@link Iterable} is stateless. Therefore, each {@link Iterable#iterator()} produces a new set of
+ * handles.
*
*
* @return a new iterable
@@ -254,7 +264,7 @@ default boolean isResolvable() {
Iterable extends Handle> handles();
/**
- * Returns stream of {@link Handle} objects.
+ * Returns stream of {@link Handle} objects.
*
* @return a new stream of contextual reference handles
*/
@@ -281,7 +291,7 @@ interface Handle extends AutoCloseable {
* @see Instance#get()
* @throws IllegalStateException If the producing {@link Instance} does not exist
* @throws IllegalStateException If invoked on {@link Handle} that previously successfully destroyed its
- * underlying contextual reference
+ * underlying contextual reference
*/
T get();
diff --git a/api/src/main/java/jakarta/enterprise/inject/Intercepted.java b/api/src/main/java/jakarta/enterprise/inject/Intercepted.java
index 17c90e32..5a7b0cb3 100644
--- a/api/src/main/java/jakarta/enterprise/inject/Intercepted.java
+++ b/api/src/main/java/jakarta/enterprise/inject/Intercepted.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -30,19 +30,19 @@
*
* An interceptor may inject metadata about the bean it is intercepting.
*
- *
+ *
* @author Pete Muir
* @since 1.1
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/Model.java b/api/src/main/java/jakarta/enterprise/inject/Model.java
index fcd74c57..0eedb4e3 100644
--- a/api/src/main/java/jakarta/enterprise/inject/Model.java
+++ b/api/src/main/java/jakarta/enterprise/inject/Model.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -32,7 +32,7 @@
* The built-in stereotype intended for use with beans that define the model layer of an MVC web application architecture such
* as JSF.
*
- *
+ *
* @see Stereotype
* @author Gavin King
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/Produces.java b/api/src/main/java/jakarta/enterprise/inject/Produces.java
index 666c84d5..a91b5878 100644
--- a/api/src/main/java/jakarta/enterprise/inject/Produces.java
+++ b/api/src/main/java/jakarta/enterprise/inject/Produces.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -27,90 +27,90 @@
import jakarta.enterprise.context.Dependent;
/**
- *
+ *
*
* Identifies a producer method or field. May be applied to a method or field of a bean class.
*
- *
+ *
*
* A producer method must be a non-abstract method of a managed bean class or session bean class. A producer method may be
* either static or non-static. If the bean is a session bean, the producer method must be either a business method of the EJB
* or a static method of the bean class.
*
* A producer field must be a field of a managed bean class or session bean class. A producer field may be either static or
* non-static. If the bean is a session bean, the producer field must be a static field of the bean class.
*
- *
+ *
*
- * public class Shop {
- * @Produces @ApplicationScoped
- * @Catalog @Named("catalog")
+ * public class Shop {
+ * @Produces @ApplicationScoped
+ * @Catalog @Named("catalog")
* List<Product> products = ...;
* ...
* }
*
- *
+ *
*
* If a producer method sometimes returns a null value, or if a producer field sometimes contains a null value when accessed,
* then the producer method or field must have scope {@link Dependent @Dependent}.
*
- *
+ *
*
* A producer method return type or producer field type may not be a type variable.
*
- *
+ *
*
* If the producer method return type or producer field type is a parameterized type, it must specify an actual type parameter
* or type variable for each type parameter.
*
- *
+ *
*
* If the producer method return type or producer field type is a parameterized type with a type variable, it must have scope
* {@link Dependent @Dependent}.
*
- *
+ *
*
* A producer method may have any number of parameters. All producer method parameters are injection points.
*
- *
+ *
*
* public class OrderFactory {
- *
+ *
* @Produces
* @ConversationScoped
* public Order createCurrentOrder(Shop shop, @Selected Product product) {
* Order order = new Order(product, shop);
* return order;
* }
- *
+ *
* }
*
- *
+ *
*
* A bean may declare multiple producer methods or fields.
*
- *
+ *
*
* Producer methods and fields are not inherited by bean subclasses.
*
- *
+ *
*
* Interceptors and decorators may not declare producer methods or fields.
*
- *
+ *
* @see Disposes @Disposes
- *
+ *
* @author Gavin King
* @author Pete Muir
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/ResolutionException.java b/api/src/main/java/jakarta/enterprise/inject/ResolutionException.java
index 8755260d..81a644f7 100644
--- a/api/src/main/java/jakarta/enterprise/inject/ResolutionException.java
+++ b/api/src/main/java/jakarta/enterprise/inject/ResolutionException.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -17,7 +17,7 @@
/**
* Indicates a problem relating to typesafe resolution.
- *
+ *
* @author Gavin King
*/
public class ResolutionException extends InjectionException {
diff --git a/api/src/main/java/jakarta/enterprise/inject/Specializes.java b/api/src/main/java/jakarta/enterprise/inject/Specializes.java
index e6473537..60230e89 100644
--- a/api/src/main/java/jakarta/enterprise/inject/Specializes.java
+++ b/api/src/main/java/jakarta/enterprise/inject/Specializes.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -31,38 +31,44 @@
*
* Indicates that a bean directly specializes another bean. May be applied to a bean class or producer method.
*
- *
+ *
*
* If a bean directly specializes a second bean, it inherits:
*
- *
+ *
*
*
all qualifiers of the second bean, and
*
the name, if any, of the second bean.
*
- *
+ *
*
- * If the second bean has a name, the bean may not declare a name using {@link jakarta.inject.Named @Named}. Furthermore, the
+ * If the second bean has a name, the bean may not declare a name using {@link jakarta.inject.Named @Named}. Furthermore,
+ * the
* bean must have all the bean types of the second bean.
*
- *
+ *
*
- *
If a bean class of a managed bean is annotated @Specializes , then the bean class must directly extend the
+ *
If a bean class of a managed bean is annotated @Specializes , then the bean class must directly extend
+ * the
* bean class of a second managed bean. Then the first managed bean directly specializes the second managed bean.
- *
- *
If a bean class of a session bean is annotated @Specializes , then the bean class must directly extend the
+ *
+ *
If a bean class of a session bean is annotated @Specializes , then the bean class must directly extend
+ * the
* bean class of a second session bean. Then the first session bean directly specializes the second session bean.
- *
- *
If a producer method is annotated @Specializes, then it must be non-static and directly override another
+ *
+ *
If a producer method is annotated @Specializes, then it must be non-static and directly override
+ * another
* producer method. Then the first producer method directly specializes the second producer method.
*
- *
+ *
*
* If a bean is specialized by any enabled bean, the first bean is disabled.
*
*
- *
CDI Lite implementations are not required to provide support for specialization.
- *
+ *
+ * CDI Lite implementations are not required to provide support for specialization.
+ *
+ *
* @author Gavin King
* @author Pete Muir
*/
@@ -71,7 +77,7 @@
@Retention(RUNTIME)
@Documented
public @interface Specializes {
-
+
/**
* Supports inline instantiation of the {@link Specializes} annotation.
*
diff --git a/api/src/main/java/jakarta/enterprise/inject/Stereotype.java b/api/src/main/java/jakarta/enterprise/inject/Stereotype.java
index 49b26644..4c57f6c3 100644
--- a/api/src/main/java/jakarta/enterprise/inject/Stereotype.java
+++ b/api/src/main/java/jakarta/enterprise/inject/Stereotype.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -27,31 +27,31 @@
*
* Specifies that an annotation type is a stereotype.
*
- *
+ *
*
* In many systems, use of architectural patterns produces a set of recurring bean roles. A stereotype allows a framework
* developer to identify such a role and declare some common metadata for beans with that role in a central place.
*
- *
+ *
*
* A bean may declare zero, one or multiple stereotypes, by applying the stereotype annotation to the bean class or producer
* method or field.
*
- *
+ *
*
* A stereotype encapsulates any combination of:
*
- *
+ *
*
*
a default scope, and
*
a set of interceptor bindings.
*
- *
+ *
*
* The default scope of a stereotype is defined by annotating the stereotype with a scope type. A stereotype may declare at most
* one scope. If a bean explicitly declares a scope, any default scopes declared by its stereotypes are ignored.
*
* The interceptor bindings of a stereotype are defined by annotating the stereotype with the interceptor binding types. A
* stereotype may declare zero, one or multiple interceptor bindings. An interceptor binding declared by a stereotype is
* inherited by any bean that declares that stereotype.
*
all beans with the stereotype have defaulted bean EL names, or that
*
all beans with the stereotype are alternatives, or that
*
all beans with the stereotype have predefined {@code @Priority}.
*
- *
+ *
*
- * A stereotype may declare an empty {@link jakarta.inject.Named @Named} annotation, which specifies that every bean with the
+ * A stereotype may declare an empty {@link jakarta.inject.Named @Named} annotation, which specifies that every bean with
+ * the
* stereotype has a defaulted name when a name is not explicitly specified by the bean.
*
* A stereotype may declare a {@link jakarta.annotation.Priority @Priority} annotation, which specifies that
* every bean with the stereotype is enabled and has given priority.
@@ -138,9 +139,9 @@
* A stereotype may declare other stereotypes. Stereotype declarations are transitive. A stereotype declared by a second
* stereotype is inherited by all beans and other stereotypes that declare the second stereotype.
*
- *
+ *
* @see Model the built-in stereotype @Model
- *
+ *
* @author Pete Muir
* @author Gavin King
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/TransientReference.java b/api/src/main/java/jakarta/enterprise/inject/TransientReference.java
index aaf93bfc..373aec5d 100644
--- a/api/src/main/java/jakarta/enterprise/inject/TransientReference.java
+++ b/api/src/main/java/jakarta/enterprise/inject/TransientReference.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -28,21 +28,22 @@
/**
*
- * If a parameter annotated with @TransientReference resolves to a dependent scoped bean, then the bean will be
+ * If a parameter annotated with @TransientReference resolves to a dependent scoped bean, then the bean will
+ * be
* destroyed after the invocation completes.
*
- *
+ *
*
* public class OrderManager {
- *
- * @Inject
+ *
+ * @Inject
* public OrderManager(@TransientReference Order order) {
* ...
- *
+ *
* }
* }
*
- *
+ *
* @author Pete Muir
* @since 1.1
*/
@@ -51,7 +52,7 @@
@Retention(RUNTIME)
@Documented
public @interface TransientReference {
-
+
/**
* Supports inline instantiation of the {@link TransientReference} annotation.
*
diff --git a/api/src/main/java/jakarta/enterprise/inject/Typed.java b/api/src/main/java/jakarta/enterprise/inject/Typed.java
index 95174bcc..8b8a7b50 100644
--- a/api/src/main/java/jakarta/enterprise/inject/Typed.java
+++ b/api/src/main/java/jakarta/enterprise/inject/Typed.java
@@ -72,7 +72,7 @@
*/
public final static class Literal extends AnnotationLiteral implements Typed {
- public static final Literal INSTANCE = of(new Class>[]{});
+ public static final Literal INSTANCE = of(new Class>[] {});
private static final long serialVersionUID = 1L;
diff --git a/api/src/main/java/jakarta/enterprise/inject/UnproxyableResolutionException.java b/api/src/main/java/jakarta/enterprise/inject/UnproxyableResolutionException.java
index d7dcac23..7c54d241 100644
--- a/api/src/main/java/jakarta/enterprise/inject/UnproxyableResolutionException.java
+++ b/api/src/main/java/jakarta/enterprise/inject/UnproxyableResolutionException.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -21,7 +21,7 @@
* Indicates that a contextual reference for a bean with a normal scope and a certain bean type cannot be obtained because the
* bean type cannot be proxied by the container.
*
- *
+ *
* @author Pete Muir
* @author Gavin King
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/UnsatisfiedResolutionException.java b/api/src/main/java/jakarta/enterprise/inject/UnsatisfiedResolutionException.java
index e9a067b6..0752a749 100644
--- a/api/src/main/java/jakarta/enterprise/inject/UnsatisfiedResolutionException.java
+++ b/api/src/main/java/jakarta/enterprise/inject/UnsatisfiedResolutionException.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -20,7 +20,7 @@
* Indicates that no bean matches a certain combination of required type and required qualifiers and is eligible for injection
* into a certain class.
*
- *
+ *
* @author Pete Muir
* @author Gavin King
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/Vetoed.java b/api/src/main/java/jakarta/enterprise/inject/Vetoed.java
index a4a4de0d..0c346660 100644
--- a/api/src/main/java/jakarta/enterprise/inject/Vetoed.java
+++ b/api/src/main/java/jakarta/enterprise/inject/Vetoed.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -29,20 +29,20 @@
*
* Veto the processing of the class. Any beans or observer methods defined by this class will not be installed.
*
- *
+ *
*
* When placed on package, all beans in the package are prevented from being installed. If packages are split across jars,
* non-portable behavior results. An application can prevent packages being split across jars by sealing the package.
*
- *
+ *
*
* No container lifecycle events are fired for classes annotated {@link Vetoed}.
*
- *
+ *
* @author Stuart Douglas
* @since 1.1
* @see JAR File Specification
- *
+ *
*/
@Target({ ElementType.TYPE, ElementType.PACKAGE })
@Retention(RetentionPolicy.RUNTIME)
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/AnnotationBuilder.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/AnnotationBuilder.java
index a89ec852..a7c3d174 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/AnnotationBuilder.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/AnnotationBuilder.java
@@ -10,13 +10,13 @@
package jakarta.enterprise.inject.build.compatible.spi;
+import java.lang.annotation.Annotation;
+
import jakarta.enterprise.lang.model.AnnotationInfo;
import jakarta.enterprise.lang.model.AnnotationMember;
import jakarta.enterprise.lang.model.declarations.ClassInfo;
import jakarta.enterprise.lang.model.types.Type;
-import java.lang.annotation.Annotation;
-
/**
* Builder for annotations of given type.
* Expected usage is:
@@ -780,7 +780,7 @@ default AnnotationBuilder value(Annotation[] values) {
*
* @return the built {@link AnnotationInfo}, never {@code null}
* @throws IllegalStateException if a value of some annotation member was not set, and that member
- * does not declare a default value
+ * does not declare a default value
*/
AnnotationInfo build();
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/AnnotationBuilderFactory.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/AnnotationBuilderFactory.java
index 36258e3c..51f9e60b 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/AnnotationBuilderFactory.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/AnnotationBuilderFactory.java
@@ -10,10 +10,10 @@
package jakarta.enterprise.inject.build.compatible.spi;
-import jakarta.enterprise.lang.model.declarations.ClassInfo;
-
import java.lang.annotation.Annotation;
+import jakarta.enterprise.lang.model.declarations.ClassInfo;
+
/**
* Supports instantiating {@link AnnotationBuilder}.
* Should not be called directly by users; the static methods on {@link AnnotationBuilder} are preferred.
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BeanInfo.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BeanInfo.java
index df54baab..2b482764 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BeanInfo.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/BeanInfo.java
@@ -10,13 +10,14 @@
package jakarta.enterprise.inject.build.compatible.spi;
+import java.util.Collection;
+
import jakarta.enterprise.invoke.InvokerBuilder;
import jakarta.enterprise.lang.model.AnnotationInfo;
import jakarta.enterprise.lang.model.declarations.ClassInfo;
import jakarta.enterprise.lang.model.declarations.FieldInfo;
import jakarta.enterprise.lang.model.declarations.MethodInfo;
import jakarta.enterprise.lang.model.types.Type;
-import java.util.Collection;
/**
* Beans are:
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/ClassConfig.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/ClassConfig.java
index a3dd0662..dfc7cca8 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/ClassConfig.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/ClassConfig.java
@@ -10,13 +10,13 @@
package jakarta.enterprise.inject.build.compatible.spi;
-import jakarta.enterprise.lang.model.AnnotationInfo;
-import jakarta.enterprise.lang.model.declarations.ClassInfo;
-
import java.lang.annotation.Annotation;
import java.util.Collection;
import java.util.function.Predicate;
+import jakarta.enterprise.lang.model.AnnotationInfo;
+import jakarta.enterprise.lang.model.declarations.ClassInfo;
+
/**
* Allows adding annotations to and removing annotations from a class.
* Note that the class is not physically altered, the modifications
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/DeclarationConfig.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/DeclarationConfig.java
index ec6027af..7877dae1 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/DeclarationConfig.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/DeclarationConfig.java
@@ -10,12 +10,12 @@
package jakarta.enterprise.inject.build.compatible.spi;
-import jakarta.enterprise.lang.model.AnnotationInfo;
-import jakarta.enterprise.lang.model.declarations.DeclarationInfo;
-
import java.lang.annotation.Annotation;
import java.util.function.Predicate;
+import jakarta.enterprise.lang.model.AnnotationInfo;
+import jakarta.enterprise.lang.model.declarations.DeclarationInfo;
+
/**
* Allows adding annotations to and removing annotations from a declaration.
* Note that the declaration is not physically altered, the modifications
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/FieldConfig.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/FieldConfig.java
index 445b37b6..41809f34 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/FieldConfig.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/FieldConfig.java
@@ -10,12 +10,12 @@
package jakarta.enterprise.inject.build.compatible.spi;
-import jakarta.enterprise.lang.model.AnnotationInfo;
-import jakarta.enterprise.lang.model.declarations.FieldInfo;
-
import java.lang.annotation.Annotation;
import java.util.function.Predicate;
+import jakarta.enterprise.lang.model.AnnotationInfo;
+import jakarta.enterprise.lang.model.declarations.FieldInfo;
+
/**
* Allows adding annotations to and removing annotations from a field.
* Note that the field is not physically altered, the modifications
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/InjectionPointInfo.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/InjectionPointInfo.java
index 9f45d90e..6d4a7343 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/InjectionPointInfo.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/InjectionPointInfo.java
@@ -10,10 +10,11 @@
package jakarta.enterprise.inject.build.compatible.spi;
+import java.util.Collection;
+
import jakarta.enterprise.lang.model.AnnotationInfo;
import jakarta.enterprise.lang.model.declarations.DeclarationInfo;
import jakarta.enterprise.lang.model.types.Type;
-import java.util.Collection;
/**
* An injection point defined on some bean. Injection points may be fields
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/InterceptorInfo.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/InterceptorInfo.java
index 63647af4..43823816 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/InterceptorInfo.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/InterceptorInfo.java
@@ -10,11 +10,11 @@
package jakarta.enterprise.inject.build.compatible.spi;
+import java.util.Collection;
+
import jakarta.enterprise.inject.spi.InterceptionType;
import jakarta.enterprise.lang.model.AnnotationInfo;
-import java.util.Collection;
-
/**
* Interceptors are managed beans annotated {@link jakarta.interceptor.Interceptor @Interceptor}.
* An interceptor declares a set of {@linkplain jakarta.interceptor.InterceptorBinding interceptor binding annotations},
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/MetaAnnotations.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/MetaAnnotations.java
index ce1d2c96..35f982b4 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/MetaAnnotations.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/MetaAnnotations.java
@@ -10,10 +10,9 @@
package jakarta.enterprise.inject.build.compatible.spi;
-import jakarta.enterprise.context.spi.AlterableContext;
-
import java.lang.annotation.Annotation;
-import java.util.function.Consumer;
+
+import jakarta.enterprise.context.spi.AlterableContext;
/**
* Allows registering custom CDI meta-annotations: qualifiers, interceptor bindings,
@@ -72,7 +71,7 @@ public interface MetaAnnotations {
* @param scopeAnnotation the scope annotation type, must not be {@code null}
* @param contextClass the context class, must not be {@code null}
* @throws IllegalArgumentException if the {@code scopeAnnotation} is not meta-annotated {@code @NormalScope}
- * or {@code @Scope}
+ * or {@code @Scope}
*/
void addContext(Class extends Annotation> scopeAnnotation, Class extends AlterableContext> contextClass);
@@ -88,5 +87,6 @@ public interface MetaAnnotations {
* @param isNormal whether the scope is normal
* @param contextClass the context class, must not be {@code null}
*/
- void addContext(Class extends Annotation> scopeAnnotation, boolean isNormal, Class extends AlterableContext> contextClass);
+ void addContext(Class extends Annotation> scopeAnnotation, boolean isNormal,
+ Class extends AlterableContext> contextClass);
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/MethodConfig.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/MethodConfig.java
index 7ece8a60..aee868a1 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/MethodConfig.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/MethodConfig.java
@@ -10,13 +10,13 @@
package jakarta.enterprise.inject.build.compatible.spi;
-import jakarta.enterprise.lang.model.AnnotationInfo;
-import jakarta.enterprise.lang.model.declarations.MethodInfo;
-
import java.lang.annotation.Annotation;
import java.util.List;
import java.util.function.Predicate;
+import jakarta.enterprise.lang.model.AnnotationInfo;
+import jakarta.enterprise.lang.model.declarations.MethodInfo;
+
/**
* Allows adding annotations to and removing annotations from a method.
* Note that the method is not physically altered, the modifications
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/ObserverInfo.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/ObserverInfo.java
index 52f66eac..21510550 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/ObserverInfo.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/ObserverInfo.java
@@ -10,14 +10,15 @@
package jakarta.enterprise.inject.build.compatible.spi;
+import java.util.Collection;
+
+import jakarta.enterprise.event.Reception;
+import jakarta.enterprise.event.TransactionPhase;
import jakarta.enterprise.lang.model.AnnotationInfo;
import jakarta.enterprise.lang.model.declarations.ClassInfo;
import jakarta.enterprise.lang.model.declarations.MethodInfo;
import jakarta.enterprise.lang.model.declarations.ParameterInfo;
import jakarta.enterprise.lang.model.types.Type;
-import java.util.Collection;
-import jakarta.enterprise.event.Reception;
-import jakarta.enterprise.event.TransactionPhase;
/**
* Observers are:
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/ParameterConfig.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/ParameterConfig.java
index 05407dec..17e14ac9 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/ParameterConfig.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/ParameterConfig.java
@@ -10,12 +10,12 @@
package jakarta.enterprise.inject.build.compatible.spi;
-import jakarta.enterprise.lang.model.AnnotationInfo;
-import jakarta.enterprise.lang.model.declarations.ParameterInfo;
-
import java.lang.annotation.Annotation;
import java.util.function.Predicate;
+import jakarta.enterprise.lang.model.AnnotationInfo;
+import jakarta.enterprise.lang.model.declarations.ParameterInfo;
+
/**
* Allows adding annotations to and removing annotations from a method parameter.
* Note that the method parameter is not physically altered, the modifications
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/Parameters.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/Parameters.java
index 96b28dc7..6cef3a40 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/Parameters.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/Parameters.java
@@ -20,10 +20,10 @@
*
*
*
a synthetic bean {@linkplain SyntheticBeanCreator creation} and
- * {@linkplain SyntheticBeanDisposer destruction} function, defined by
- * {@link SyntheticBeanBuilder};
+ * {@linkplain SyntheticBeanDisposer destruction} function, defined by
+ * {@link SyntheticBeanBuilder};
*
a synthetic observer {@linkplain SyntheticObserver notification}
- * function, defined by {@link SyntheticObserverBuilder}.
+ * function, defined by {@link SyntheticObserverBuilder}.
*
*
* Parameter values are transferred from the builder to the {@code Parameters}-accepting
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/ScannedClasses.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/ScannedClasses.java
index fcf76959..3c44069e 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/ScannedClasses.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/ScannedClasses.java
@@ -26,7 +26,7 @@ public interface ScannedClasses {
* by the container, leads to non-portable behavior.
*
* @param className binary name of the class, as defined by The Java™ Language Specification;
- * in other words, the class name as returned by {@link Class#getName()}
+ * in other words, the class name as returned by {@link Class#getName()}
*/
void add(String className);
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SecurityActions.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SecurityActions.java
index a3edbeba..550c8fcc 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SecurityActions.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SecurityActions.java
@@ -26,7 +26,6 @@ private SecurityActions() {
static ServiceLoader loadService(Class service, ClassLoader classLoader) {
return AccessController.doPrivileged(
- (PrivilegedAction>) () -> ServiceLoader.load(service, classLoader)
- );
+ (PrivilegedAction>) () -> ServiceLoader.load(service, classLoader));
}
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SkipIfPortableExtensionPresent.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SkipIfPortableExtensionPresent.java
index e3207071..10ad684f 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SkipIfPortableExtensionPresent.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SkipIfPortableExtensionPresent.java
@@ -10,13 +10,13 @@
package jakarta.enterprise.inject.build.compatible.spi;
-import jakarta.enterprise.inject.spi.Extension;
-
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import jakarta.enterprise.inject.spi.Extension;
+
/**
* If a {@linkplain BuildCompatibleExtension build compatible extension} is annotated
* {@code @SkipIfPortableExtensionPresent}, it is ignored when the CDI container
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/StereotypeInfo.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/StereotypeInfo.java
index f6c7d216..8f923d5c 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/StereotypeInfo.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/StereotypeInfo.java
@@ -10,9 +10,10 @@
package jakarta.enterprise.inject.build.compatible.spi;
-import jakarta.enterprise.lang.model.AnnotationInfo;
import java.util.Collection;
+import jakarta.enterprise.lang.model.AnnotationInfo;
+
/**
* A stereotype. May define {@linkplain #defaultScope() default scope},
* a set of {@linkplain #interceptorBindings() interceptor bindings},
@@ -55,7 +56,7 @@ public interface StereotypeInfo {
* Returns {@code null} if this stereotype is not meta-annotated {@code @Priority}.
*
* @return the {@link jakarta.annotation.Priority @Priority} value declared by this stereotype, or {@code null}
- * if this stereotype is not meta-annotated {@code @Priority}
+ * if this stereotype is not meta-annotated {@code @Priority}
*/
Integer priority();
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticBeanBuilder.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticBeanBuilder.java
index 8a74e44f..74d76881 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticBeanBuilder.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticBeanBuilder.java
@@ -10,12 +10,12 @@
package jakarta.enterprise.inject.build.compatible.spi;
+import java.lang.annotation.Annotation;
+
import jakarta.enterprise.lang.model.AnnotationInfo;
import jakarta.enterprise.lang.model.declarations.ClassInfo;
import jakarta.enterprise.lang.model.types.Type;
-import java.lang.annotation.Annotation;
-
/**
* Builder for synthetic beans.
* Instances are not reusable. For each synthetic bean, new instance
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticComponents.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticComponents.java
index d6ecc44a..3e83ab0d 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticComponents.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticComponents.java
@@ -47,6 +47,7 @@ public interface SyntheticComponents {
*
* This method is supposed to be called with explicitly provided type arguments. For example,
* to define a synthetic observer of event type {@code List}, one would call:
+ *
*
{@code
* // types is of type Types
* // syntheticComponents is of type SyntheticComponents
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticObserverBuilder.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticObserverBuilder.java
index 4e2b102c..dc7b9ce3 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticObserverBuilder.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/SyntheticObserverBuilder.java
@@ -10,13 +10,13 @@
package jakarta.enterprise.inject.build.compatible.spi;
+import java.lang.annotation.Annotation;
+
import jakarta.enterprise.event.TransactionPhase;
import jakarta.enterprise.lang.model.AnnotationInfo;
import jakarta.enterprise.lang.model.declarations.ClassInfo;
import jakarta.enterprise.lang.model.types.Type;
-import java.lang.annotation.Annotation;
-
/**
* Builder for synthetic observers.
* Instances are not reusable. For each synthetic observer, new instance
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/Types.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/Types.java
index c7fa2649..c497fe01 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/Types.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/Types.java
@@ -31,7 +31,8 @@ public interface Types {
* For example:
*
*
{@code of(void.class)}: same as {@link #ofVoid() ofVoid}{@code ()}
- *
{@code of(int.class)}: same as {@link #ofPrimitive(PrimitiveType.PrimitiveKind) ofPrimitive}{@code (PrimitiveKind.INT)}
+ *
{@code of(int.class)}: same as {@link #ofPrimitive(PrimitiveType.PrimitiveKind)
+ * ofPrimitive}{@code (PrimitiveKind.INT)}
*
{@code of(String.class)}: same as {@link #ofClass(ClassInfo) ofClass}{@code (... ClassInfo for String ...)}
*
{@code of(int[].class)}: same as {@link #ofArray(Type, int) ofArray}{@code (ofPrimitive(PrimitiveKind.INT), 1)}
*
{@code of(String[][].class)}: same as {@code ofArray(ofClass(... ClassInfo for String ...), 2)}
@@ -100,7 +101,7 @@ public interface Types {
* @param typeArguments one or more type arguments
* @return the parameterized type, never {@code null}
* @throws IllegalArgumentException if given {@code genericType} is not generic or if the number of type arguments
- * does not match the number of type parameters declared by {@code genericType}
+ * does not match the number of type parameters declared by {@code genericType}
*/
ParameterizedType parameterized(Class> genericType, Class>... typeArguments);
@@ -113,12 +114,12 @@ public interface Types {
* @param typeArguments one or more type arguments
* @return the parameterized type, never {@code null}
* @throws IllegalArgumentException if given {@code genericType} is not generic or if the number of type arguments
- * does not match the number of type parameters declared by {@code genericType}
+ * does not match the number of type parameters declared by {@code genericType}
*/
ParameterizedType parameterized(Class> genericType, Type... typeArguments);
/**
- * Returns a {@link ParameterizedType} for the given generic type and type arguments.
+ * Returns a {@link ParameterizedType} for the given generic type and type arguments.
* The array of type arguments must have the same shape as the generic type's
* list of type parameters.
*
@@ -126,7 +127,7 @@ public interface Types {
* @param typeArguments one or more type arguments
* @return the parameterized type, never {@code null}
* @throws IllegalArgumentException if given {@code genericType} is not generic or if the number of type arguments
- * does not match the number of type parameters declared by {@code genericType}
+ * does not match the number of type parameters declared by {@code genericType}
*/
ParameterizedType parameterized(ClassType genericType, Type... typeArguments);
diff --git a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/package-info.java b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/package-info.java
index e6222925..852da099 100644
--- a/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/package-info.java
+++ b/api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/package-info.java
@@ -9,7 +9,9 @@
*/
/**
- *
diff --git a/api/src/main/java/jakarta/enterprise/inject/se/SeContainer.java b/api/src/main/java/jakarta/enterprise/inject/se/SeContainer.java
index faf9f70d..7a16c019 100644
--- a/api/src/main/java/jakarta/enterprise/inject/se/SeContainer.java
+++ b/api/src/main/java/jakarta/enterprise/inject/se/SeContainer.java
@@ -28,20 +28,22 @@
* If no qualifier is passed to {@link #select} method, the @Default qualifier is assumed.
*
*
- *
CDI Lite implementations are not required to provide support for CDI in Java SE.
+ *
+ * CDI Lite implementations are not required to provide support for CDI in Java SE.
+ *
* Shuts down this SeContainer instance when it is no longer in scope. Implemented from {@link AutoCloseable},
*
+ *
* @throws IllegalStateException if the container is already shutdown
*/
@Override
@@ -53,7 +55,7 @@ public interface SeContainer extends Instance,AutoCloseable {
*
* @return true if called before container shutdown
*/
- boolean isRunning();
+ boolean isRunning();
/**
* Get the CDI BeanManager for this container
@@ -61,7 +63,7 @@ public interface SeContainer extends Instance,AutoCloseable {
* @return the BeanManager
* @throws IllegalStateException if called when the container is already shutdown
*/
- BeanManager getBeanManager();
+ BeanManager getBeanManager();
/**
* Get the CDI {@link BeanContainer} for this container.
diff --git a/api/src/main/java/jakarta/enterprise/inject/se/SeContainerInitializer.java b/api/src/main/java/jakarta/enterprise/inject/se/SeContainerInitializer.java
index 2765cb49..9dbc2712 100644
--- a/api/src/main/java/jakarta/enterprise/inject/se/SeContainerInitializer.java
+++ b/api/src/main/java/jakarta/enterprise/inject/se/SeContainerInitializer.java
@@ -30,45 +30,45 @@
*
* By default, the discovery is enabled so that all beans from all discovered bean archives are considered. However, it's
* possible to define a "synthetic" bean archive, or the set of bean classes and enablement respectively:
*
* In the same manner, it is possible to explicitly declare interceptors, decorators, extensions and implementation specific
* options using the builder.
*
CDI Lite implementations are not required to provide support for CDI in Java SE.
+ *
+ * CDI Lite implementations are not required to provide support for CDI in Java SE.
+ *
*
* @author Antoine Sabot-Durand
* @author Martin Kouba
@@ -101,7 +103,8 @@ public static SeContainerInitializer newInstance() {
private static SeContainerInitializer findSeContainerInitializer() {
SeContainerInitializer result;
- Iterator iterator = ServiceLoader.load(SeContainerInitializer.class, SeContainerInitializer.class.getClassLoader()).iterator();
+ Iterator iterator = ServiceLoader
+ .load(SeContainerInitializer.class, SeContainerInitializer.class.getClassLoader()).iterator();
if (!iterator.hasNext()) {
throw new IllegalStateException("No valid CDI implementation found");
@@ -124,11 +127,12 @@ private static SeContainerInitializer findSeContainerInitializer() {
*/
public abstract SeContainerInitializer addBeanClasses(Class>... classes);
-
/**
- * All classes from the packages of the specified classes will be added to the set of bean classes for the synthetic bean archive.
+ * All classes from the packages of the specified classes will be added to the set of bean classes for the synthetic bean
+ * archive.
*
- * Note that the scanning possibilities are limited. Therefore, only directories and jar files from the filesystem are supported.
+ * Note that the scanning possibilities are limited. Therefore, only directories and jar files from the filesystem are
+ * supported.
*
*
* Scanning may also have negative impact on SE performance.
@@ -140,25 +144,27 @@ private static SeContainerInitializer findSeContainerInitializer() {
public abstract SeContainerInitializer addPackages(Class>... packageClasses);
/**
- * Packages of the specified classes will be scanned and found classes will be added to the set of bean classes for the synthetic bean archive.*
+ * Packages of the specified classes will be scanned and found classes will be added to the set of bean classes for the
+ * synthetic bean archive.*
*
- * Note that the scanning possibilities are limited. Therefore, only directories and jar files from the filesystem are supported.
+ * Note that the scanning possibilities are limited. Therefore, only directories and jar files from the filesystem are
+ * supported.
*
*
* Scanning may also have negative impact on SE performance.
*
*
* @param scanRecursively should subpackages be scanned or not
- * @param packageClasses classes whose packages will be scanned
+ * @param packageClasses classes whose packages will be scanned
* @return self
*/
public abstract SeContainerInitializer addPackages(boolean scanRecursively, Class>... packageClasses);
-
/**
* All classes from the specified packages will be added to the set of bean classes for the synthetic bean archive.
*
- * Note that the scanning possibilities are limited. Therefore, only directories and jar files from the filesystem are supported.
+ * Note that the scanning possibilities are limited. Therefore, only directories and jar files from the filesystem are
+ * supported.
*
*
* Scanning may also have negative impact on SE performance.
@@ -172,14 +178,15 @@ private static SeContainerInitializer findSeContainerInitializer() {
/**
* All classes from the specified packages will be added to the set of bean classes for the synthetic bean archive.
*
- * Note that the scanning possibilities are limited. Therefore, only directories and jar files from the filesystem are supported.
+ * Note that the scanning possibilities are limited. Therefore, only directories and jar files from the filesystem are
+ * supported.
*
*
* Scanning may also have negative impact on SE performance.
*
*
* @param scanRecursively should subpackages be scanned or not
- * @param packages packages that will be added to the synthetic bean archive
+ * @param packages packages that will be added to the synthetic bean archive
* @return self
*/
public abstract SeContainerInitializer addPackages(boolean scanRecursively, Package... packages);
@@ -206,6 +213,7 @@ private static SeContainerInitializer findSeContainerInitializer() {
*
* This method does not add any class to the set of bean classes of the synthetic bean archive.
*
+ *
* @param interceptorClasses classes of the interceptors to enable.
* @return self
*/
@@ -216,6 +224,7 @@ private static SeContainerInitializer findSeContainerInitializer() {
*
* This method does not add any class to the set of bean classes of the synthetic bean archive.
*
+ *
* @param decoratorClasses classes of the decorators to enable.
* @return self
*/
@@ -226,6 +235,7 @@ private static SeContainerInitializer findSeContainerInitializer() {
*
* This method does not add any class to the set of bean classes of the synthetic bean archive.
*
+ *
* @param alternativeClasses classes of the alternatives to select
* @return self
*/
@@ -236,16 +246,18 @@ private static SeContainerInitializer findSeContainerInitializer() {
*
* This method does not add any class to the set of bean classes of the synthetic bean archive.
*
+ *
* @param alternativeStereotypeClasses alternatives stereotypes to select
* @return self
*/
@SuppressWarnings("unchecked")
- public abstract SeContainerInitializer selectAlternativeStereotypes(Class extends Annotation>... alternativeStereotypeClasses);
+ public abstract SeContainerInitializer selectAlternativeStereotypes(
+ Class extends Annotation>... alternativeStereotypeClasses);
/**
* Add a configuration property to the container
*
- * @param key property name
+ * @param key property name
* @param value property value
* @return self
*/
@@ -261,14 +273,16 @@ private static SeContainerInitializer findSeContainerInitializer() {
public abstract SeContainerInitializer setProperties(Map properties);
/**
- * By default, the discovery is enabled. However, it's possible to disable the discovery completely so that only the "synthetic" bean archive is considered.
+ * By default, the discovery is enabled. However, it's possible to disable the discovery completely so that only the
+ * "synthetic" bean archive is considered.
*
* @return self
*/
public abstract SeContainerInitializer disableDiscovery();
/**
- * Set a {@link ClassLoader}. The given {@link ClassLoader} will be scanned automatically for bean archives if scanning is enabled.
+ * Set a {@link ClassLoader}. The given {@link ClassLoader} will be scanned automatically for bean archives if scanning is
+ * enabled.
*
* @param classLoader the class loader to use
* @return self
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/AfterBeanDiscovery.java b/api/src/main/java/jakarta/enterprise/inject/spi/AfterBeanDiscovery.java
index c128669f..1a94a28f 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/AfterBeanDiscovery.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/AfterBeanDiscovery.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -34,7 +34,7 @@
* {@linkplain Observes observer methods} and {@linkplain jakarta.enterprise.context custom context}
* objects with the container.
*
- *
+ *
*
@@ -43,8 +43,10 @@
* error by the container.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
- *
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ *
* @author David Allen
* @author Antoine Sabot-Durand
*/
@@ -52,7 +54,7 @@ public interface AfterBeanDiscovery {
/**
* Registers a definition error with the container, causing the container to abort deployment after all observers have been
* notified.
- *
+ *
* @param t The definition error as a {@link java.lang.Throwable}
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -90,14 +92,15 @@ public interface AfterBeanDiscovery {
* {@link ObserverMethod} and then registers the
* {@link ObserverMethod} with the container, thereby making it available for event
* notifications.
- *
+ *
* @param observerMethod The custom observer method to add to the deployment
* @throws IllegalStateException if called outside of the observer method invocation
*/
public void addObserverMethod(ObserverMethod> observerMethod);
/**
- * obtains a new {@link ObserverMethodConfigurator} to configure a new {@link ObserverMethod} and add it at the end of the observer invocation.
+ * obtains a new {@link ObserverMethodConfigurator} to configure a new {@link ObserverMethod} and add it at the end of the
+ * observer invocation.
* It will then fire an event of type {@link ProcessObserverMethod} containing the built
* {@link ObserverMethod} from this configuration and then registers the
* {@link ObserverMethod} with the container, thereby making it available for event
@@ -114,16 +117,16 @@ public interface AfterBeanDiscovery {
/**
* Registers a custom {@link Context} object with the container.
- *
+ *
* @param context The custom context to add to the deployment
- * @throws IllegalStateException if called outside of the observer method invocation
+ * @throws IllegalStateException if called outside of the observer method invocation
*/
public void addContext(Context context);
/**
* Obtain the {@link AnnotatedType} that may be used to read the annotations of the given class or interface as defined
* during container initialization.
- *
+ *
* @param the class or interface
* @param type the {@link java.lang.Class} object
* @param id the type identifier. If null, the fully qualifier class name of type is used
@@ -136,7 +139,7 @@ public interface AfterBeanDiscovery {
/**
* Obtain the {@link AnnotatedType}s that may be used to read the annotations of the given class or interface as defined
* during container initialization.
- *
+ *
* @param the class or interface
* @param type the {@link java.lang.Class} object
* @return the {@link AnnotatedType}s
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/AfterDeploymentValidation.java b/api/src/main/java/jakarta/enterprise/inject/spi/AfterDeploymentValidation.java
index c877457e..9f2a56c8 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/AfterDeploymentValidation.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/AfterDeploymentValidation.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -25,7 +25,9 @@
* No requests will be processed by the deployment until all observers of this event return.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @author David Allen
*/
@@ -34,7 +36,7 @@ public interface AfterDeploymentValidation {
/**
* Registers a deployment problem with the container, causing the container to abort deployment after all observers have
* been notified.
- *
+ *
* @param t The deployment problem as a {@link java.lang.Throwable}
* @throws IllegalStateException if called outside of the observer method invocation
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/AfterTypeDiscovery.java b/api/src/main/java/jakarta/enterprise/inject/spi/AfterTypeDiscovery.java
index 4079dd21..a74cae6c 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/AfterTypeDiscovery.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/AfterTypeDiscovery.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -16,9 +16,10 @@
package jakarta.enterprise.inject.spi;
-import jakarta.enterprise.inject.spi.configurator.AnnotatedTypeConfigurator;
import java.util.List;
+import jakarta.enterprise.inject.spi.configurator.AnnotatedTypeConfigurator;
+
/**
*
* This event type is thrown by the container after type discovery is complete. If any observer method of the
@@ -31,7 +32,9 @@
* Changes made to these lists after the invocation of the last observer method of the {@code AfterTypeDiscovery} are ignored.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @author Pete Muir
* @author Antoine Sabot-Durand
@@ -40,19 +43,22 @@
public interface AfterTypeDiscovery {
/**
- * @return the list of enabled alternatives for the application, sorted by priority in ascending order. Alternatives enabled for a bean archive are not included.
+ * @return the list of enabled alternatives for the application, sorted by priority in ascending order. Alternatives enabled
+ * for a bean archive are not included.
* @throws IllegalStateException if called outside of the observer method invocation
*/
public List> getAlternatives();
/**
- * @return the list of enabled interceptors for the application, sorted by priority in ascending order. Interceptors enabled for a bean archive are not included.
+ * @return the list of enabled interceptors for the application, sorted by priority in ascending order. Interceptors enabled
+ * for a bean archive are not included.
* @throws IllegalStateException if called outside of the observer method invocation
*/
public List> getInterceptors();
/**
- * @return the list of enabled decorators for the application, sorted by priority in ascending order. Decorators enabled for a bean archive are not included.
+ * @return the list of enabled decorators for the application, sorted by priority in ascending order. Decorators enabled for
+ * a bean archive are not included.
* @throws IllegalStateException if called outside of the observer method invocation
*/
public List> getDecorators();
@@ -64,7 +70,8 @@ public interface AfterTypeDiscovery {
*
*
*
- * Thanks to the id parameter, this method allows multiple annotated types, based on the same underlying type, to be defined. {@link AnnotatedType}s
+ * Thanks to the id parameter, this method allows multiple annotated types, based on the same underlying type, to be
+ * defined. {@link AnnotatedType}s
* discovered by the container use the fully qualified class name of {@link AnnotatedType#getJavaClass()} to identify the
* type.
*
- * Thanks to the id parameter, this method allows multiple annotated types, based on the same underlying type, to be defined. {@link AnnotatedType}s
+ * Thanks to the id parameter, this method allows multiple annotated types, based on the same underlying type, to be
+ * defined. {@link AnnotatedType}s
* discovered by the container use the fully qualified class name of {@link AnnotatedType#getJavaClass()} to identify the
* type.
*
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/Annotated.java b/api/src/main/java/jakarta/enterprise/inject/spi/Annotated.java
index e0d51d70..6fcb076f 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/Annotated.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/Annotated.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -25,14 +25,14 @@
*
* Represents a Java program element that can be annotated.
*
- *
+ *
* @see java.lang.reflect.AnnotatedElement
- *
+ *
* @author Gavin King
* @author Pete Muir
* @author Clint Popetz
* @author John D. Ament
- *
+ *
*/
public interface Annotated {
@@ -40,7 +40,7 @@ public interface Annotated {
*
* Get the type of the annotated program element.
*
- *
+ *
* @return the type of the annotated program element
*/
Type getBaseType();
@@ -49,7 +49,7 @@ public interface Annotated {
*
* Get all types to which the base type should be considered assignable.
*
- *
+ *
* @return a set of all types to which the base type should be considered assignable
*/
Set getTypeClosure();
@@ -60,7 +60,7 @@ public interface Annotated {
*
* The behavior of this method is intended to be the same behavior as {@link AnnotatedElement#getAnnotation(Class)},
* where repeatable annotations are not supported.
- *
+ *
*
* @param the type of the annotation
* @param annotationType the class of the annotation type
@@ -78,7 +78,7 @@ public interface Annotated {
* where repeatable annotations are supported.
*
*
- * @param the type of the annotation
+ * @param the type of the annotation
* @param annotationType the class of the annotation type
* @return the program element annotations of the given annotation type, or an empty collection
*/
@@ -88,7 +88,7 @@ public interface Annotated {
*
* Get all annotations of the program element.
*
- *
+ *
* @return all annotations of the program element, or an empty set if no annotations are present
*/
Set getAnnotations();
@@ -101,7 +101,8 @@ public interface Annotated {
* program element.
*
* @param annotationType the annotation type to check for
- * @return true if the program element has an annotation of the given annotation type, or false otherwise
+ * @return true if the program element has an annotation of the given annotation type, or false
+ * otherwise
*/
boolean isAnnotationPresent(Class extends Annotation> annotationType);
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedCallable.java b/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedCallable.java
index 5b5f0754..c460c37c 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedCallable.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedCallable.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -21,10 +21,10 @@
*
* Represents a callable member of a Java type.
*
- *
+ *
* @author Gavin King
* @author Pete Muir
- *
+ *
* @param the declaring type
*/
public interface AnnotatedCallable extends AnnotatedMember {
@@ -33,7 +33,7 @@ public interface AnnotatedCallable extends AnnotatedMember {
*
* Get the parameters of the callable member.
*
- *
+ *
* @return the parameters
*/
public List> getParameters();
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedConstructor.java b/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedConstructor.java
index 9d9ae5fc..c30cf090 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedConstructor.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedConstructor.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -16,21 +16,21 @@
package jakarta.enterprise.inject.spi;
+import static java.util.Arrays.asList;
+
import java.lang.annotation.Annotation;
import java.lang.reflect.Constructor;
import java.util.LinkedHashSet;
import java.util.Set;
-import static java.util.Arrays.asList;
-
/**
*
* Represents a constructor of a Java class.
*
- *
+ *
* @author Gavin King
* @author Pete Muir
- *
+ *
* @param the declaring class
* @see Constructor
*/
@@ -40,12 +40,13 @@ public interface AnnotatedConstructor extends AnnotatedCallable {
*
* Get the underlying {@link Constructor}.
*
- *
+ *
* @return the constructor
*/
public Constructor getJavaMember();
- @Override default Set getAnnotations(Class annotationType) {
+ @Override
+ default Set getAnnotations(Class annotationType) {
T[] annotationsByType = getJavaMember().getAnnotationsByType(annotationType);
return new LinkedHashSet<>(asList(annotationsByType));
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedField.java b/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedField.java
index 41f1e7b2..2287d24a 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedField.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedField.java
@@ -8,28 +8,28 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package jakarta.enterprise.inject.spi;
+import static java.util.Arrays.asList;
+
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.util.LinkedHashSet;
import java.util.Set;
-import static java.util.Arrays.asList;
-
/**
*
* Represents a field of a Java class.
*
- *
+ *
* @author Gavin King
* @author Pete Muir
- *
+ *
* @param the declaring type
* @see Field
*/
@@ -39,12 +39,13 @@ public interface AnnotatedField extends AnnotatedMember {
*
* Get the underlying {@link Field}.
*
- *
+ *
* @return the {@link Field}
*/
public Field getJavaMember();
- @Override default Set getAnnotations(Class annotationType) {
+ @Override
+ default Set getAnnotations(Class annotationType) {
T[] annotationsByType = getJavaMember().getAnnotationsByType(annotationType);
return new LinkedHashSet<>(asList(annotationsByType));
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedMember.java b/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedMember.java
index ceffb59b..4e15e5ae 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedMember.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedMember.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -22,10 +22,10 @@
*
* Represents a member of a Java type.
*
- *
+ *
* @author Gavin King
* @author Pete Muir
- *
+ *
* @param the declaring type
* @see Member
*/
@@ -34,7 +34,7 @@ public interface AnnotatedMember extends Annotated {
*
* Get the underlying {@link Member}.
*
- *
+ *
* @return the {@link Member}
*/
public Member getJavaMember();
@@ -43,7 +43,7 @@ public interface AnnotatedMember extends Annotated {
*
* Determines if the member is static.
*
- *
+ *
* @return true if the member is static
*/
public boolean isStatic();
@@ -52,7 +52,7 @@ public interface AnnotatedMember extends Annotated {
*
* Get the {@linkplain AnnotatedType type} which defines this member.
*
- *
+ *
* @return the type which defines this member
*/
public AnnotatedType getDeclaringType();
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedMethod.java b/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedMethod.java
index 38f5f104..9d6a9167 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedMethod.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedMethod.java
@@ -8,28 +8,28 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package jakarta.enterprise.inject.spi;
+import static java.util.Arrays.asList;
+
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.LinkedHashSet;
import java.util.Set;
-import static java.util.Arrays.asList;
-
/**
*
* Represents a method of a Java type.
*
- *
+ *
* @author Gavin King
* @author Pete Muir
- *
+ *
* @param the declaring type
* @see Method
*/
@@ -39,12 +39,13 @@ public interface AnnotatedMethod extends AnnotatedCallable {
*
* Get the underlying {@link Method}.
*
- *
+ *
* @return the {@link Method}
*/
public Method getJavaMember();
- @Override default Set getAnnotations(Class annotationType) {
+ @Override
+ default Set getAnnotations(Class annotationType) {
T[] annotationsByType = getJavaMember().getAnnotationsByType(annotationType);
return new LinkedHashSet<>(asList(annotationsByType));
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedParameter.java b/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedParameter.java
index 71a517a5..faab9547 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedParameter.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedParameter.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -16,6 +16,8 @@
package jakarta.enterprise.inject.spi;
+import static java.util.Arrays.asList;
+
import java.lang.annotation.Annotation;
import java.lang.reflect.Executable;
import java.lang.reflect.Member;
@@ -23,17 +25,15 @@
import java.util.LinkedHashSet;
import java.util.Set;
-import static java.util.Arrays.asList;
-
/**
*
* Represents a parameter of a method or constructor.
*
- *
+ *
* @author Gavin King
* @author Pete Muir
* @author Jozef Hartinger
- *
+ *
* @param the type that declares the method or constructor
*/
public interface AnnotatedParameter extends Annotated {
@@ -42,7 +42,7 @@ public interface AnnotatedParameter extends Annotated {
*
* Get the position of the parameter in the method or constructor argument list.
*
- *
+ *
* @return the position of the parameter
*/
public int getPosition();
@@ -51,7 +51,7 @@ public interface AnnotatedParameter extends Annotated {
*
* Get the declaring {@linkplain AnnotatedCallable method or constructor}.
*
- *
+ *
* @return the declaring callable
*/
public AnnotatedCallable getDeclaringCallable();
@@ -70,7 +70,8 @@ default Parameter getJavaParameter() {
return executable.getParameters()[getPosition()];
}
- @Override default Set getAnnotations(Class annotationType) {
+ @Override
+ default Set getAnnotations(Class annotationType) {
T[] annotationsByType = getJavaParameter().getAnnotationsByType(annotationType);
return new LinkedHashSet<>(asList(annotationsByType));
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedType.java b/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedType.java
index a7702349..e41b8fd1 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedType.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedType.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -16,20 +16,20 @@
package jakarta.enterprise.inject.spi;
+import static java.util.Arrays.asList;
+
import java.lang.annotation.Annotation;
import java.util.LinkedHashSet;
import java.util.Set;
-import static java.util.Arrays.asList;
-
/**
*
* Represents a Java class or interface.
*
- *
+ *
* @author Gavin King
* @author Pete Muir
- *
+ *
* @param the type
* @see java.lang.Class
*/
@@ -39,7 +39,7 @@ public interface AnnotatedType extends Annotated {
*
* Get the underlying {@link java.lang.Class}.
*
- *
+ *
* @return the {@link java.lang.Class}
*/
public Class getJavaClass();
@@ -49,7 +49,7 @@ public interface AnnotatedType extends Annotated {
* Get the {@linkplain AnnotatedConstructor constructors} of the type. If an empty set is returned, a default constructor
* with no parameters will be assumed.
*
- *
+ *
* @return the constructors, or an empty set if none are defined
*/
public Set> getConstructors();
@@ -58,7 +58,7 @@ public interface AnnotatedType extends Annotated {
*
* Get the {@linkplain AnnotatedMethod methods} of the type.
*
- *
+ *
* @return the methods, or an empty set if none are defined
*/
public Set> getMethods();
@@ -67,12 +67,13 @@ public interface AnnotatedType extends Annotated {
*
* Get the {@linkplain AnnotatedField fields} of the type.
*
- *
+ *
* @return the fields, or an empty set if none are defined
*/
public Set> getFields();
- @Override default Set getAnnotations(Class annotationType) {
+ @Override
+ default Set getAnnotations(Class annotationType) {
T[] annotationsByType = getJavaClass().getAnnotationsByType(annotationType);
return new LinkedHashSet<>(asList(annotationsByType));
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/Bean.java b/api/src/main/java/jakarta/enterprise/inject/spi/Bean.java
index e400ee75..59bca2ef 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/Bean.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/Bean.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -19,14 +19,13 @@
import java.util.Set;
import jakarta.enterprise.context.spi.Contextual;
-import jakarta.enterprise.context.spi.CreationalContext;
/**
*
* Represents an {@linkplain jakarta.enterprise.inject enabled bean}. This interface defines everything the container needs to
* manage instances of the bean.
*
- *
+ *
* @author Gavin King
* @author David Allen
* @param the class of the bean instance
@@ -36,7 +35,7 @@ public interface Bean extends Contextual, BeanAttributes {
/**
* The bean {@linkplain Class class} of the managed bean or session bean or of the bean that declares the producer method or
* field.
- *
+ *
* @return the bean {@linkplain Class class}
*/
public Class> getBeanClass();
@@ -44,7 +43,7 @@ public interface Bean extends Contextual, BeanAttributes {
/**
* Obtains the {@link InjectionPoint} objects representing injection points of the bean, that
* will be validated by the container at initialization time.
- *
+ *
* @return the set of {@linkplain InjectionPoint injection points} of the bean
*/
public Set getInjectionPoints();
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/BeanAttributes.java b/api/src/main/java/jakarta/enterprise/inject/spi/BeanAttributes.java
index 318c2add..cfd06ce0 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/BeanAttributes.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/BeanAttributes.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -25,7 +25,7 @@
/**
* The BeanAttributes interface exposes the basic attributes of a bean.
- *
+ *
* @author Pete Muir
* @since 1.1
* @param the class of the bean instance
@@ -34,35 +34,35 @@ public interface BeanAttributes {
/**
* Obtains the {@linkplain jakarta.enterprise.inject bean types} of the bean.
- *
+ *
* @return the {@linkplain jakarta.enterprise.inject bean types}
*/
public Set getTypes();
/**
* Obtains the {@linkplain jakarta.inject.Qualifier qualifiers} of the bean.
- *
+ *
* @return the {@linkplain jakarta.inject.Qualifier qualifiers}
*/
public Set getQualifiers();
/**
* Obtains the {@linkplain jakarta.enterprise.context scope} of the bean.
- *
+ *
* @return the {@linkplain jakarta.enterprise.context scope}
*/
public Class extends Annotation> getScope();
/**
* Obtains the {@linkplain jakarta.enterprise.inject EL name} of a bean, if it has one.
- *
+ *
* @return the {@linkplain jakarta.enterprise.inject EL name}
*/
public String getName();
/**
* Obtains the {@linkplain Stereotype stereotypes} of the bean.
- *
+ *
* @return the set of {@linkplain Stereotype stereotypes}
*/
public Set> getStereotypes();
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 97b3cf32..7ce21f84 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/BeanContainer.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/BeanContainer.java
@@ -1,5 +1,11 @@
package jakarta.enterprise.inject.spi;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+
import jakarta.enterprise.context.ContextNotActiveException;
import jakarta.enterprise.context.Dependent;
import jakarta.enterprise.context.spi.Context;
@@ -11,12 +17,6 @@
import jakarta.enterprise.inject.Instance;
import jakarta.enterprise.inject.Stereotype;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.Collection;
-import java.util.List;
-import java.util.Set;
-
/**
*
* {@code BeanContainer} is a superclass of {@link BeanManager} containing capabilities that are portable across
@@ -47,14 +47,14 @@ public interface BeanContainer {
* Obtains a contextual reference for a certain {@linkplain Bean bean} and a certain bean type of the bean.
*
*
- * @param bean the {@link Bean} object representing the bean
+ * @param bean the {@link Bean} object representing the bean
* @param beanType a bean type that must be implemented by any client proxy that is returned
- * @param ctx a {@link CreationalContext} that may be used to destroy any object with scope
- * {@link Dependent} that is created
+ * @param ctx a {@link CreationalContext} that may be used to destroy any object with scope
+ * {@link Dependent} that is created
* @return a contextual reference representing the bean
* @throws IllegalArgumentException if the given type is not a bean type of the given bean
- * @throws IllegalStateException if called during application initialization, before the {@link AfterDeploymentValidation}
- * event is fired.
+ * @throws IllegalStateException if called during application initialization, before the {@link AfterDeploymentValidation}
+ * event is fired.
*/
Object getReference(Bean> bean, Type beanType, CreationalContext> ctx);
@@ -62,9 +62,9 @@ public interface BeanContainer {
* Obtain an instance of a {@link CreationalContext} for the given
* {@linkplain Contextual contextual type}, or for a non-contextual object.
*
- * @param type of the instance
+ * @param type of the instance
* @param contextual the {@link Contextual}, or a null value in the case of a non-contextual
- * object
+ * object
* @return the new {@link CreationalContext}
*/
CreationalContext createCreationalContext(Contextual contextual);
@@ -79,14 +79,14 @@ public interface BeanContainer {
* Note that when called during invocation of an {@link AfterBeanDiscovery} event observer,
* this method will only return beans discovered by the container before the {@link AfterBeanDiscovery} event is fired.
*
- * @param beanType the required bean type
+ * @param beanType the required bean type
* @param qualifiers the required qualifiers
* @return the resulting set of {@linkplain Bean beans}
* @throws IllegalArgumentException if the given type represents a type variable
* @throws IllegalArgumentException if two instances of the same non repeating qualifier type are given
* @throws IllegalArgumentException if an instance of an annotation that is not a qualifier type is given
- * @throws IllegalStateException if called during application initialization, before the {@link AfterBeanDiscovery}
- * event is fired.
+ * @throws IllegalStateException if called during application initialization, before the {@link AfterBeanDiscovery}
+ * event is fired.
*/
Set> getBeans(Type beanType, Annotation... qualifiers);
@@ -102,7 +102,7 @@ public interface BeanContainer {
* @param name the EL name
* @return the resulting set of {@linkplain Bean beans}
* @throws IllegalStateException if called during application initialization, before the {@link AfterBeanDiscovery}
- * event is fired.
+ * event is fired.
*/
Set> getBeans(String name);
@@ -112,12 +112,12 @@ public interface BeanContainer {
* Note that when called during invocation of an {@link AfterBeanDiscovery} event observer,
* this method will only return beans discovered by the container before the {@link AfterBeanDiscovery} event is fired.
*
- * @param a common type of the beans
+ * @param a common type of the beans
* @param beans a set of {@linkplain Bean beans} of the given type
* @return the resolved bean, or null if null or an empty set is passed
* @throws AmbiguousResolutionException if the ambiguous dependency resolution rules fail
- * @throws IllegalStateException if called during application initialization, before the {@link AfterBeanDiscovery}
- * event is fired.
+ * @throws IllegalStateException if called during application initialization, before the {@link AfterBeanDiscovery}
+ * event is fired.
*/
Bean extends X> resolve(Set> beans);
@@ -127,15 +127,15 @@ public interface BeanContainer {
* Note that when called during invocation of an {@link AfterBeanDiscovery} event observer,
* this method will only return observers discovered by the container before the {@link AfterBeanDiscovery} event is fired.
*
- * @param the type of the event
- * @param event the event object
+ * @param the type of the event
+ * @param event the event object
* @param qualifiers the event qualifiers
* @return the resulting set of {@linkplain ObserverMethod observer methods}
* @throws IllegalArgumentException if the runtime type of the event object contains a type variable
* @throws IllegalArgumentException if two instances of the same non repeating qualifier type are given
* @throws IllegalArgumentException if an instance of an annotation that is not a qualifier type is given
- * @throws IllegalStateException if called during application initialization, before the {@link AfterBeanDiscovery}
- * event is fired.
+ * @throws IllegalStateException if called during application initialization, before the {@link AfterBeanDiscovery}
+ * event is fired.
*/
Set> resolveObserverMethods(T event, Annotation... qualifiers);
@@ -150,14 +150,14 @@ public interface BeanContainer {
* this method will only return interceptors discovered by the container before the {@link AfterBeanDiscovery} event is
* fired.
*
- * @param type the type of the interception
+ * @param type the type of the interception
* @param interceptorBindings the interceptor bindings
* @return the resulting set of {@linkplain Interceptor interceptors}
* @throws IllegalArgumentException if no interceptor binding type is given
* @throws IllegalArgumentException if two instances of the same interceptor binding type are given
* @throws IllegalArgumentException if an instance of an annotation that is not an interceptor binding type is given
- * @throws IllegalStateException if called during application initialization, before the {@link AfterBeanDiscovery}
- * event is fired.
+ * @throws IllegalStateException if called during application initialization, before the {@link AfterBeanDiscovery}
+ * event is fired.
*/
List> resolveInterceptors(InterceptionType type, Annotation... interceptorBindings);
@@ -198,8 +198,9 @@ public interface BeanContainer {
* binding type} .
*
* @param annotationType the annotation to test
- * @return true if the annotation type is a {@linkplain jakarta.interceptor.InterceptorBinding interceptor binding
- * type}
+ * @return true if the annotation type is a {@linkplain jakarta.interceptor.InterceptorBinding interceptor
+ * binding
+ * type}
*/
boolean isInterceptorBinding(Class extends Annotation> annotationType);
@@ -210,7 +211,7 @@ public interface BeanContainer {
* @param scopeType the {@linkplain jakarta.enterprise.context scope}
* @return the {@linkplain Context context object}
* @throws ContextNotActiveException if there is no active context object for the given scope
- * @throws IllegalArgumentException if there is more than one active context object for the given scope
+ * @throws IllegalArgumentException if there is more than one active context object for the given scope
*/
Context getContext(Class extends Annotation> scopeType);
@@ -224,7 +225,8 @@ public interface BeanContainer {
Collection getContexts(Class extends Annotation> scopeType);
/**
- * Returns an instance of Event with specified type java.lang.Object and specified qualifier @Default
+ * 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.
*
* @return a new {@link Event} object whose event type is Object and qualifier @Default
@@ -232,22 +234,23 @@ public interface BeanContainer {
*/
Event getEvent();
-
/**
* Obtains an {@link Instance} object to access to beans instances.
*
- * The returned Instance object can only access instances of beans that are available for injection in the module
+ * The returned Instance object can only access instances of beans that are available for injection in the
+ * module
* or library containing the class into which the BeanManager/BeanContainer was injected
* or, in the Jakarta EE environment, the Jakarta EE component from whose JNDI environment namespace the
* BeanContainer was obtained, according to the rules of typesafe resolution.
*
- * Instances of dependent scoped beans obtained with this Instance must be explicitly destroyed by calling {@link Instance#destroy(Object)}
+ * Instances of dependent scoped beans obtained with this Instance must be explicitly destroyed by calling
+ * {@link Instance#destroy(Object)}
*
* If no qualifier is passed to {@link Instance#select} method, the @Default qualifier is assumed.
*
* @return an {@link Instance} object to request beans instances
* @throws IllegalStateException if called during application initialization, before the {@link AfterDeploymentValidation}
- * event is fired.
+ * event is fired.
* @since 2.0
*/
Instance createInstance();
@@ -266,9 +269,10 @@ public interface BeanContainer {
* @param requiredType required type of an injection point; must not be {@code null}
* @param requiredQualifiers required qualifiers of an injection point; must not be {@code null}
* @return true if a bean with given bean types and qualifiers would be assignable
- * to an injection point with given required type and required qualifiers, false otherwise
+ * to an injection point with given required type and required qualifiers, false otherwise
*/
- boolean isMatchingBean(Set beanTypes, Set beanQualifiers, Type requiredType, Set requiredQualifiers);
+ boolean isMatchingBean(Set beanTypes, Set beanQualifiers, Type requiredType,
+ Set requiredQualifiers);
/**
* Returns true if an event object with given type and qualifiers would match
@@ -284,7 +288,8 @@ public interface BeanContainer {
* @param observedEventType observed event type of an observer method; must not be {@code null}
* @param observedEventQualifiers observed event qualifiers on an observer method; must not be {@code null}
* @return true if an event object with given type and qualifiers would result in notifying
- * an observer method with given observed event type and observed event qualifiers, false otherwise
+ * an observer method with given observed event type and observed event qualifiers, false otherwise
*/
- boolean isMatchingEvent(Type eventType, Set eventQualifiers, Type observedEventType, Set observedEventQualifiers);
+ boolean isMatchingEvent(Type eventType, Set eventQualifiers, Type observedEventType,
+ Set observedEventQualifiers);
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/BeanManager.java b/api/src/main/java/jakarta/enterprise/inject/spi/BeanManager.java
index 47abcabc..c4e2aff5 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/BeanManager.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/BeanManager.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -16,20 +16,20 @@
package jakarta.enterprise.inject.spi;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.List;
+import java.util.Set;
+
import jakarta.el.ELResolver;
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.Stereotype;
import jakarta.enterprise.inject.UnsatisfiedResolutionException;
import jakarta.enterprise.util.Nonbinding;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.List;
-import java.util.Set;
-
-import jakarta.enterprise.inject.Stereotype;
/**
*
@@ -41,49 +41,50 @@
* In CDI Lite environment, applications may obtain a {@code BeanManager}, but invoking methods that are not inherited
* from {@link BeanContainer} results in non-portable behavior.
*
- *
+ *
*
* Any bean may obtain an instance of BeanManager by injecting it:
*
- *
+ *
*
* @Inject
* BeanManager manager;
*
- *
+ *
*
- * Java EE components may obtain an instance of BeanManager from {@linkplain javax.naming JNDI} by looking up the name
+ * Java EE components may obtain an instance of BeanManager from {@linkplain javax.naming JNDI} by looking up the
+ * name
* {@code java:comp/BeanManager}.
*
- *
+ *
*
* Most operations of BeanManager may be called at any time during the execution of the application.
*
- *
- * However, the following operations must not be called before the {@link AfterBeanDiscovery} event is fired:
+ *
+ * However, the following operations must not be called before the {@link AfterBeanDiscovery} event is fired:
*
- *
+ *
* @author Gavin King
* @author Pete Muir
* @author Clint Popetz
@@ -97,23 +98,23 @@ public interface BeanManager extends BeanContainer {
* Obtains an injectable reference for a certain {@linkplain InjectionPoint injection point}.
*
*
- * @param ij the target injection point
+ * @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
+ * {@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.
+ * @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);
/**
* Returns the {@link PassivationCapable} bean with the given identifier.
*
- * Note that when called during invocation of an {@link AfterBeanDiscovery} event observer,
+ * Note that when called during invocation of an {@link AfterBeanDiscovery} event observer,
* this method will only return beans discovered by the container before the {@link AfterBeanDiscovery} event is fired.
- *
+ *
* @param id the identifier
* @return a {@link Bean} that implements {@link PassivationCapable} and has the given
* identifier, or a null value if there is no such bean
@@ -126,9 +127,9 @@ public interface BeanManager extends BeanContainer {
* Validate a certain {@linkplain InjectionPoint injection point}.
*
* Note that when called during invocation of an {@link AfterBeanDiscovery} event observer,
- * this method will only validate injection points discovered by the container before the {@link AfterBeanDiscovery}
+ * this method will only validate injection points discovered by the container before the {@link AfterBeanDiscovery}
* event is fired.
- *
+ *
* @param injectionPoint the {@linkplain InjectionPoint injection point} to validate
* @throws InjectionException if there is a deployment problem (for example, an unsatisfied or unresolvable ambiguous
* dependency) associated with the injection point
@@ -144,7 +145,7 @@ public interface BeanManager extends BeanContainer {
*
* Note that when called during invocation of an {@link AfterBeanDiscovery} event observer,
* this method will only return decorators discovered by the container before the {@link AfterBeanDiscovery} event is fired.
- *
+ *
* @param types the set of bean types of the decorated bean
* @param qualifiers the qualifiers declared by the decorated bean
* @return the resulting set of {@linkplain Decorator decorators}
@@ -158,7 +159,7 @@ public interface BeanManager extends BeanContainer {
/**
* Test the given annotation type to determine if it is a passivating {@linkplain jakarta.enterprise.context scope type}.
- *
+ *
* @param annotationType the annotation type
* @return true if the annotation type is a passivating scope type
*/
@@ -167,7 +168,7 @@ public interface BeanManager extends BeanContainer {
/**
* Obtains the set of meta-annotations for a certain {@linkplain jakarta.interceptor.InterceptorBinding interceptor binding
* type} .
- *
+ *
* @param bindingType the {@linkplain jakarta.interceptor.InterceptorBinding interceptor binding type}
* @return the set of meta-annotations
*/
@@ -175,7 +176,7 @@ public interface BeanManager extends BeanContainer {
/**
* Obtains meta-annotations for a certain {@linkplain Stereotype stereotype}.
- *
+ *
* @param stereotype the {@linkplain Stereotype stereotype}
* @return the set of meta-annotations
*/
@@ -184,7 +185,7 @@ public interface BeanManager extends BeanContainer {
/**
* Determine if two qualifiers are considered equivalent for the purposes of typesafe resolution, taking into account any
* members annotated with {@link Nonbinding}.
- *
+ *
* @param qualifier1 a qualifier to check
* @param qualifier2 a qualifier to check
* @return true if the two qualifiers are equivalent, otherwise false
@@ -195,7 +196,7 @@ public interface BeanManager extends BeanContainer {
/**
* Determine if two interceptor bindings are considered equivalent for the purposes of typesafe resolution, taking into
* account any members annotated with {@link Nonbinding}.
- *
+ *
* @param interceptorBinding1 an interceptor binding to check
* @param interceptorBinding2 an interceptor binding to check
* @return true if the two interceptor bindings are equivalent, otherwise false
@@ -206,7 +207,7 @@ public interface BeanManager extends BeanContainer {
/**
* Determine the hash code of a qualifier, using the JDK algorithm for determining an annotation hash code, ignoring any
* members annotated with {@link Nonbinding}.
- *
+ *
* @param qualifier the qualifier to consider
* @return the hashCode for the qualifier
* @since 1.1
@@ -216,7 +217,7 @@ public interface BeanManager extends BeanContainer {
/**
* Determine the hash code of an interceptor binding, using the JDK algorithm for determining an annotation hash code,
* ignoring any members annotated with {@link Nonbinding}.
- *
+ *
* @param interceptorBinding the interceptor binding to consider
* @return the hashCode for the interceptor binding
* @since 1.1
@@ -234,11 +235,12 @@ public interface BeanManager extends BeanContainer {
/**
* Returns a wrapper {@link jakarta.el.ExpressionFactory} that delegates {@link jakarta.el.MethodExpression} and
- * {@link jakarta.el.ValueExpression} creation to the given {@link jakarta.el.ExpressionFactory}. When a Unified EL expression
+ * {@link jakarta.el.ValueExpression} creation to the given {@link jakarta.el.ExpressionFactory}. When a Unified EL
+ * expression
* is evaluated using a {@link jakarta.el.MethodExpression} or {@link jakarta.el.ValueExpression} returned by the wrapper
* {@link jakarta.el.ExpressionFactory}, the container handles destruction of objects with scope
* {@link Dependent}.
- *
+ *
* @deprecated use {@code ELAwareBeanManager}, this method will be removed in CDI 5.0
* @param expressionFactory the {@link jakarta.el.ExpressionFactory} to wrap
* @return the wrapped {@link jakarta.el.ExpressionFactory}
@@ -248,7 +250,7 @@ public interface BeanManager extends BeanContainer {
/**
* Obtain an {@link AnnotatedType} that may be used to read the annotations of the given class or interface.
- *
+ *
* @param the class or interface
* @param type the {@link java.lang.Class} object
* @return the {@link AnnotatedType}
@@ -259,7 +261,7 @@ public interface BeanManager extends BeanContainer {
*
* An implementation of {@link InjectionTargetFactory} that provides container created {@link InjectionTarget} instances.
*
- *
+ *
*
* This factory can be wrapped to add behavior to container created injection targets.
*
@@ -276,7 +278,7 @@ public interface BeanManager extends BeanContainer {
* An implementation of {@link ProducerFactory} that provides container created {@link Producer} instances for the given
* field.
*
- *
+ *
*
* This factory can be wrapped to add behavior to container created producers.
*
@@ -295,7 +297,7 @@ public interface BeanManager extends BeanContainer {
* An implementation of {@link ProducerFactory} that provides container created {@link Producer} instances for the given
* method.
*
- *
+ *
*
* This factory can be wrapped to add behavior to container created producers.
*
@@ -313,7 +315,7 @@ public interface BeanManager extends BeanContainer {
* Obtains a {@link BeanAttributes} for the given {@link AnnotatedType}. The container ignores the annotations and types
* declared by the elements of the actual Java class and uses the metadata provided via the {@link Annotated} interface
* instead.
- *
+ *
* @param the type
* @param type the {@link AnnotatedType}
* @return a container provided implementation of {@link InjectionTarget}
@@ -325,7 +327,7 @@ public interface BeanManager extends BeanContainer {
* Obtains a {@link BeanAttributes} for the given {@link AnnotatedType}. The container ignores the annotations and types
* declared by the elements of the actual Java class and uses the metadata provided via the {@link Annotated} interface
* instead.
- *
+ *
* @param type the {@link AnnotatedType}
* @return a container provided implementation of {@link InjectionTarget}
* @since 1.1
@@ -336,14 +338,15 @@ public interface BeanManager extends BeanContainer {
*
* Obtains a {@link Bean} for the given {@link BeanAttributes}, bean class and {@link InjectionTarget}.
*
- *
+ *
*
* The {@link InjectionTarget} creates and destroys instances of the bean, performs dependency injection and lifecycle
* callbacks, and determines the return value of {@link Bean#getInjectionPoints()}. The {@link InjectionTarget} is obtained
- * from the {@link InjectionTargetFactory}. {@link #getInjectionTargetFactory(AnnotatedType)} allows use of a container created
+ * from the {@link InjectionTargetFactory}. {@link #getInjectionTargetFactory(AnnotatedType)} allows use of a container
+ * created
* {@link InjectionTarget}.
*
- *
+ *
* @param the type
* @param attributes a {@link BeanAttributes} which determines the bean types, qualifiers, scope, name and stereotypes of
* the returned {@link Bean}, and the return value of {@link Bean#isAlternative()}
@@ -359,14 +362,14 @@ public Bean createBean(BeanAttributes attributes, Class beanClass,
*
* Obtains a {@link Bean} for the given {@link BeanAttributes}, bean class and {@link Producer}.
*
- *
+ *
*
* The {@link Producer} creates and destroys instances of the decorator, and determines the return value of
* {@link Bean#getInjectionPoints()}. The {@link Producer} is obtained from the {@link ProducerFactory}.
- * {@link #getProducerFactory(AnnotatedMethod, Bean)} or {@link #getProducerFactory(AnnotatedField, Bean)} allows use of a
+ * {@link #getProducerFactory(AnnotatedMethod, Bean)} or {@link #getProducerFactory(AnnotatedField, Bean)} allows use of a
* container created {@link Producer}.
*
- *
+ *
* @param the type
* @param the type of the declaring bean
* @param attributes a {@link BeanAttributes} which determines the bean types, qualifiers, scope, name and stereotypes of
@@ -380,7 +383,7 @@ public Bean createBean(BeanAttributes attributes, Class beanClass,
/**
* Obtains a container provided implementation of {@link InjectionPoint} for the given {@link AnnotatedField}.
- *
+ *
* @param field the {@link AnnotatedField} defining the injection point
* @return the container provided {@link InjectionPoint}
* @throws IllegalArgumentException if there is a definition error associated with the injection point
@@ -390,7 +393,7 @@ public Bean createBean(BeanAttributes attributes, Class beanClass,
/**
* Obtains a container provided implementation of {@link InjectionPoint} for the given {@link AnnotatedParameter}.
- *
+ *
* @param parameter the {@link AnnotatedParameter} defining the injection point
* @return the container provided {@link InjectionPoint}
* @throws IllegalArgumentException if there is a definition error associated with the injection point
@@ -400,7 +403,7 @@ public Bean createBean(BeanAttributes attributes, Class beanClass,
/**
* Obtains the container's instance of an Extension class declared in META-INF/services.
- *
+ *
* @param the type of the extension
* @param extensionClass the type of the extension class
* @return the extension instance
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/BeforeBeanDiscovery.java b/api/src/main/java/jakarta/enterprise/inject/spi/BeforeBeanDiscovery.java
index cccf0209..13b134a5 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/BeforeBeanDiscovery.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/BeforeBeanDiscovery.java
@@ -8,23 +8,23 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package jakarta.enterprise.inject.spi;
+import java.lang.annotation.Annotation;
+
import jakarta.enterprise.context.NormalScope;
+import jakarta.enterprise.context.spi.Context;
import jakarta.enterprise.inject.Stereotype;
import jakarta.enterprise.inject.spi.configurator.AnnotatedTypeConfigurator;
+import jakarta.enterprise.util.Nonbinding;
import jakarta.inject.Qualifier;
import jakarta.inject.Scope;
import jakarta.interceptor.InterceptorBinding;
-import java.lang.annotation.Annotation;
-
-import jakarta.enterprise.context.spi.Context;
-import jakarta.enterprise.util.Nonbinding;
/**
*
@@ -32,7 +32,9 @@
* {@code BeforeBeanDiscovery} event throws an exception, the exception is treated as a definition error by the container.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @author Pete Muir
* @author David Allen
@@ -43,11 +45,11 @@ public interface BeforeBeanDiscovery {
*
* Declares an annotation type as a {@linkplain jakarta.inject.Qualifier} qualifier type.
*
- *
+ *
*
* This is only required if you wish to make an annotation a qualifier without adding {@link Qualifier} to it.
*
- *
+ *
* @param qualifier The annotation to treat as a qualifier
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -57,11 +59,11 @@ public interface BeforeBeanDiscovery {
*
* Declares an annotation type as a {@linkplain jakarta.inject.Qualifier} qualifier type.
*
- *
+ *
*
* This is only required if you wish to make an annotation a qualifier without adding {@link Qualifier} to it.
*
- *
+ *
* @param qualifier The annotation to treat as a qualifier
* @throws IllegalStateException if called outside of the observer method invocation
* @since 1.1
@@ -72,14 +74,14 @@ public interface BeforeBeanDiscovery {
*
* Declares an annotation type as a {@linkplain jakarta.enterprise.context scope type}.
*
- *
+ *
*
* This is only required if you wish to make an annotation a scope type without adding the {@link NormalScope} or
* {@link Scope} annotations to it. You can also use this method to override an existing normal scope definition.
*
- *
+ *
* @see AfterBeanDiscovery#addContext(Context)
- *
+ *
* @param scopeType The annotation type to treat as a {@linkplain jakarta.enterprise.context scope type}
* @param normal Indicates if the scope is normal
* @param passivating Indicates if the scope is {@linkplain PassivationCapable passivation
@@ -93,12 +95,12 @@ public interface BeforeBeanDiscovery {
* Declares an annotation type as a {@linkplain Stereotype stereotype}, and specifies its
* meta-annotations.
*
- *
+ *
*
* This is only required if you wish to make an annotation a stereotype without adding {@link Stereotype} to it. You can
* also use this method to override an existing stereotype definition.
*
- *
+ *
* @param stereotype The annotation type to treat as a {@linkplain Stereotype stereotype}
* @param stereotypeDef An optional list of annotations defining the {@linkplain Stereotype
* stereotype}
@@ -110,12 +112,12 @@ public interface BeforeBeanDiscovery {
*
* Declares an annotation type as an {@linkplain Interceptor interceptor} binding type.
*
- *
+ *
*
* This is only required if you wish to make an annotation an interceptor binding type without adding
* {@link InterceptorBinding} to it.
*
- *
+ *
* @param bindingType The annotation type to treat as an interceptor binding type
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -125,12 +127,12 @@ public interface BeforeBeanDiscovery {
*
* Declares an annotation type as an {@linkplain Interceptor interceptor} binding type, and specifies its meta-annotations.
*
- *
+ *
*
* This is only required if you wish to make an annotation an interceptor binding type without adding
* {@link InterceptorBinding} to it.
*
- *
+ *
* @param bindingType The annotation type to treat as an interceptor binding type
* @param bindingTypeDef An optional list of annotations defining the {@linkplain Interceptor interceptor}
* @throws IllegalStateException if called outside of the observer method invocation
@@ -143,18 +145,19 @@ public interface BeforeBeanDiscovery {
* Adds a given {@link AnnotatedType} to the set of types which will be scanned during bean
* discovery.
*
- *
+ *
*
- * Thanks to the id parameter, this method allows multiple annotated types, based on the same underlying type, to be defined. {@link AnnotatedType}s
+ * Thanks to the id parameter, this method allows multiple annotated types, based on the same underlying type, to be
+ * defined. {@link AnnotatedType}s
* discovered by the container use the fully qualified class name of {@link AnnotatedType#getJavaClass()} to identify the
* type.
*
- *
+ *
*
* {@link AfterBeanDiscovery#getAnnotatedType(Class, String)} and {@link AfterBeanDiscovery#getAnnotatedTypes(Class)} allows
* annotated types to be obtained by identifier.
*
- *
+ *
* @param type The {@link AnnotatedType} to add for later scanning
* @param id the identifier used to distinguish this AnnotatedType from an other one based on the same underlying type
* @throws IllegalStateException if called outside of the observer method invocation
@@ -169,7 +172,8 @@ public interface BeforeBeanDiscovery {
*
*
*
- * Thanks to the id parameter, this method allows multiple annotated types, based on the same underlying type, to be defined with a builder.
+ * Thanks to the id parameter, this method allows multiple annotated types, based on the same underlying type, to be defined
+ * with a builder.
* {@link AnnotatedType}s discovered by the container use the fully qualified class name of
* {@link AnnotatedType#getJavaClass()} to identify the type.
*
@@ -191,7 +195,6 @@ public interface BeforeBeanDiscovery {
*/
public AnnotatedTypeConfigurator addAnnotatedType(Class type, String id);
-
/**
*
*
@@ -210,8 +213,7 @@ public interface BeforeBeanDiscovery {
* @return a non reusable {@link AnnotatedTypeConfigurator} to configure the qualifier
* @since 2.0
*/
- AnnotatedTypeConfigurator configureQualifier(Class qualifier);
-
+ AnnotatedTypeConfigurator configureQualifier(Class qualifier);
/**
*
@@ -232,7 +234,6 @@ public interface BeforeBeanDiscovery {
* @return a non reusable {@link AnnotatedTypeConfigurator} to configure the interceptor binding
* @since 2.0
*/
- AnnotatedTypeConfigurator configureInterceptorBinding(Class bindingType);
-
+ AnnotatedTypeConfigurator configureInterceptorBinding(Class bindingType);
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/BeforeShutdown.java b/api/src/main/java/jakarta/enterprise/inject/spi/BeforeShutdown.java
index 9af0fc8e..7549e7de 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/BeforeShutdown.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/BeforeShutdown.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -21,7 +21,9 @@
* observer method of the {@code BeforeShutdown} event throws an exception, the exception is ignored by the container.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @author David Allen
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/CDI.java b/api/src/main/java/jakarta/enterprise/inject/spi/CDI.java
index 0a80f406..93bc953d 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/CDI.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/CDI.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -16,8 +16,6 @@
package jakarta.enterprise.inject.spi;
-import jakarta.enterprise.inject.Instance;
-
import java.util.Collections;
import java.util.Comparator;
import java.util.ServiceConfigurationError;
@@ -25,6 +23,8 @@
import java.util.Set;
import java.util.TreeSet;
+import jakarta.enterprise.inject.Instance;
+
/**
* Provides access to the current container.
*
@@ -51,12 +51,12 @@ public abstract class CDI implements Instance {
*
* Get the CDI instance that provides access to the current container.
*
- *
+ *
*
* If there are no providers available, an {@link IllegalStateException} is thrown, otherwise the first provider which can
* access the container is used.
*
- *
+ *
* @throws IllegalStateException if no {@link CDIProvider} is available
* @return the CDI instance
*/
@@ -133,7 +133,7 @@ private static void findAllProviders() {
providerLoader = SecurityActions.loadService(CDIProvider.class, CDI.class.getClassLoader());
- if(! providerLoader.iterator().hasNext()) {
+ if (!providerLoader.iterator().hasNext()) {
throw new IllegalStateException("Unable to locate CDIProvider");
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/CDIProvider.java b/api/src/main/java/jakarta/enterprise/inject/spi/CDIProvider.java
index a87521ba..cbbeb737 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/CDIProvider.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/CDIProvider.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -18,7 +18,7 @@
/**
* Interface implemented by a CDI provider to provide access to the current container
- *
+ *
* @author Pete Muir
* @since 1.1
*/
@@ -28,13 +28,12 @@ public interface CDIProvider extends Prioritized {
/**
* Provides access to the current container
- *
+ *
* @return the CDI instance for the current container
* @throws IllegalStateException if no CDI container is available
*/
CDI getCDI();
-
@Override
default int getPriority() {
return DEFAULT_CDI_PROVIDER_PRIORITY;
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/Decorator.java b/api/src/main/java/jakarta/enterprise/inject/spi/Decorator.java
index 7581ba2c..cc33914a 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/Decorator.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/Decorator.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -31,11 +31,13 @@
* given priority value for entire application.
*
*
- *
CDI Lite implementations are not required to provide support for decorators.
+ *
+ * CDI Lite implementations are not required to provide support for decorators.
+ *
*
* @author Gavin King
* @author Pete Muir
- *
+ *
* @param the decorator bean class
*/
public interface Decorator extends Bean {
@@ -44,7 +46,7 @@ public interface Decorator extends Bean {
*
* Obtains the {@linkplain Type type} of the {@linkplain Delegate delegate injection point}.
*
- *
+ *
* @return the delegate {@linkplain Type type}
*/
public Type getDelegateType();
@@ -54,7 +56,7 @@ public interface Decorator extends Bean {
* Obtains the {@linkplain jakarta.inject.Qualifier qualifiers} of the {@linkplain Delegate delegate injection
* point}.
*
- *
+ *
* @return the delegate {@linkplain jakarta.inject.Qualifier qualifiers}
*/
public Set getDelegateQualifiers();
@@ -63,7 +65,7 @@ public interface Decorator extends Bean {
*
* Obtains the {@linkplain jakarta.decorator decorated types}.
*
- *
+ *
* @return the set of decorated {@linkplain Type types}
*/
public Set getDecoratedTypes();
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/DefinitionException.java b/api/src/main/java/jakarta/enterprise/inject/spi/DefinitionException.java
index adac4209..f7f7471a 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/DefinitionException.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/DefinitionException.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -20,22 +20,22 @@
*
* Thrown when a definition error occurs.
*
- *
+ *
*
* Definition errors are developer errors. They may be detected by tooling at development time, and are also detected by the
* container at initialization time. If a definition error exists in a deployment, initialization will be aborted by the
* container.
*
- *
+ *
*
* The container is permitted to define a non-portable mode, for use at development time, in which some definition errors do not
* cause application initialization to abort.
*
- *
+ *
*
* An implementation is permitted to throw a subclass of {@link DefinitionException} for any definition error which exists.
*
- *
+ *
* @author Pete Muir
* @since 1.1
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/DeploymentException.java b/api/src/main/java/jakarta/enterprise/inject/spi/DeploymentException.java
index 5b94d3f3..622bc8cd 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/DeploymentException.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/DeploymentException.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -20,24 +20,24 @@
*
* Thrown when a deployment problem occurs.
*
- *
+ *
*
* Deployment problems are detected by the container at initialization time. If a deployment problem exists in a deployment,
* initialization will be aborted by the container.
*
- *
+ *
*
* The container is permitted to define a non-portable mode, for use at development time, in which some deployment problems do
* not cause application initialization to abort.
*
- *
+ *
*
* An implementation is permitted to throw a subclass of {@link DeploymentException} for any deployment problem.
*
- *
+ *
* @author Pete Muir
* @since 1.1
- *
+ *
*/
public class DeploymentException extends RuntimeException {
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/EventContext.java b/api/src/main/java/jakarta/enterprise/inject/spi/EventContext.java
index 71f3a614..e3ed860c 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/EventContext.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/EventContext.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -18,7 +18,7 @@
/**
* Represents a context of a fired event. Provides access to an event object and corresponding metadata.
- *
+ *
* @author Martin Kouba
* @see ObserverMethod#notify(EventContext)
* @see EventMetadata
@@ -28,13 +28,13 @@
public interface EventContext {
/**
- *
+ *
* @return the event object, aka the payload
*/
T getEvent();
/**
- *
+ *
* @return the event metadata
*/
EventMetadata getMetadata();
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/EventMetadata.java b/api/src/main/java/jakarta/enterprise/inject/spi/EventMetadata.java
index 8889e962..e9734112 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/EventMetadata.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/EventMetadata.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -30,13 +30,13 @@
*
* {@link EventMetadata} may only be injected into an observer method. For example:
*
- *
+ *
* @see Observes
- *
+ *
* @author Lincoln Baxter, III
* @author Pete Muir
* @author Antoine Sabot-Durand
@@ -62,5 +62,5 @@ public interface EventMetadata {
* @return the runtime type of the event object
*/
public Type getType();
-
+
}
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/Extension.java b/api/src/main/java/jakarta/enterprise/inject/spi/Extension.java
index f5afeab3..fe98692c 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/Extension.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/Extension.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -23,29 +23,31 @@
*
* Service interface implemented by extensions. An extension is a service provider declared in META-INF/services.
*
- *
+ *
*
* Service providers may have {@linkplain Observes observer methods}, which may observe any event,
* including any {@linkplain jakarta.enterprise.inject.spi container lifecycle event}, and obtain an injected
* {@link BeanManager}.
*
- *
+ *
*
* The container instantiates a single instance of each extension at the beginning of the application initialization process and
* maintains a reference to it until the application shuts down. The container delivers event notifications to this instance by
* calling its observer methods.
*
- *
+ *
*
* Service providers are made available for injection as beans with the qualifier {@link Default
* @Default}.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
- *
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ *
* @author Gavin King
* @author Pete Muir
- *
+ *
*/
public interface Extension {
}
\ No newline at end of file
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/InjectionPoint.java b/api/src/main/java/jakarta/enterprise/inject/spi/InjectionPoint.java
index de146e94..3c27246d 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/InjectionPoint.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/InjectionPoint.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -21,10 +21,10 @@
import java.lang.reflect.Type;
import java.util.Set;
+import jakarta.enterprise.context.Dependent;
import jakarta.enterprise.event.Observes;
import jakarta.enterprise.inject.Disposes;
import jakarta.enterprise.inject.Instance;
-import jakarta.enterprise.context.Dependent;
import jakarta.enterprise.inject.Produces;
/**
@@ -34,36 +34,37 @@
* {@linkplain Produces producer method}, {@linkplain Disposes disposer method}
* or {@linkplain Observes observer method}.
*
- *
+ *
*
* If the injection point is a dynamically selected reference obtained then the metadata obtain reflects the injection point of
* the {@link Instance}, with the required type and any additional required qualifiers defined by {@linkplain Instance
* Instance.select()}.
*
- *
+ *
*
* Occasionally, a bean with scope {@link Dependent @Dependent} needs to access metadata relating
* to the object to which it belongs. The bean may inject an {@code InjectionPoint} representing the injection point into which
* the bean was injected.
*
- *
+ *
*
- * For example, the following producer method creates injectable Logger s. The log category of a Logger
+ * For example, the following producer method creates injectable Logger s. The log category of a
+ * Logger
* depends upon the class of the object into which it is injected.
*
* Only {@linkplain Dependent dependent} objects, may obtain information about the injection point to
* which they belong.
*
- *
+ *
* @author Gavin King
* @author Pete Muir
*/
@@ -71,14 +72,14 @@ public interface InjectionPoint {
/**
* Get the required type of injection point.
- *
+ *
* @return the required type
*/
public Type getType();
/**
* Get the required qualifiers of the injection point.
- *
+ *
* @return the required qualifiers
*/
public Set getQualifiers();
@@ -86,7 +87,7 @@ public interface InjectionPoint {
/**
* Get the {@link Bean} object representing the bean that defines the injection point. If the
* injection point does not belong to a bean, return a null value.
- *
+ *
* @return the {@link Bean} object representing bean that defines the injection point, of null
* if the injection point does not belong to a bean
*/
@@ -96,7 +97,7 @@ public interface InjectionPoint {
* Get the {@link java.lang.reflect.Field} object in the case of field injection, the {@link java.lang.reflect.Method}
* object in the case of method parameter injection or the {@link java.lang.reflect.Constructor} object in the case of
* constructor parameter injection.
- *
+ *
* @return the member
*/
public Member getMember();
@@ -105,21 +106,22 @@ public interface InjectionPoint {
* Obtain an instance of {@link AnnotatedField} or
* {@link AnnotatedParameter}, depending upon whether the injection point is an injected field
* or a constructor/method parameter.
- *
+ *
* @return an {@code AnnotatedField} or {@code AnnotatedParameter}
*/
public Annotated getAnnotated();
/**
* Determines if the injection point is a decorator delegate injection point.
- *
- * @return true if the injection point is a decorator delegate injection point, and false otherwise
+ *
+ * @return true if the injection point is a decorator delegate injection point, and false
+ * otherwise
*/
public boolean isDelegate();
/**
* Determines if the injection is a transient field.
- *
+ *
* @return true if the injection point is a transient field, and false otherwise
*/
public boolean isTransient();
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/InjectionTarget.java b/api/src/main/java/jakarta/enterprise/inject/spi/InjectionTarget.java
index 11ce7e1f..a371c9f9 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/InjectionTarget.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/InjectionTarget.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -23,11 +23,13 @@
* instance of a type.
*
*
- *
CDI Lite implementations are not required to provide support for {@code InjectionTarget}.
- *
+ *
+ * CDI Lite implementations are not required to provide support for {@code InjectionTarget}.
+ *
+ *
* @see jakarta.annotation.PostConstruct
* @see jakarta.annotation.PreDestroy
- *
+ *
* @author Pete Muir
* @author David Allen
* @param The class of the instance
@@ -39,7 +41,7 @@ public interface InjectionTarget extends Producer {
* Performs dependency injection upon the given object. Performs Java EE component environment injection, sets the value of
* all injected fields, and calls all initializer methods.
*
- *
+ *
* @param instance The instance upon which to perform injection
* @param ctx The {@link CreationalContext} to use for creating new instances
*/
@@ -47,20 +49,22 @@ public interface InjectionTarget extends Producer {
/**
*
- * Calls the {@link jakarta.annotation.PostConstruct} callback, if it exists, according to the semantics required by the Java
+ * Calls the {@link jakarta.annotation.PostConstruct} callback, if it exists, according to the semantics required by the
+ * Java
* EE platform specification.
*
- *
+ *
* @param instance The instance on which to invoke the {@link jakarta.annotation.PostConstruct} method
*/
public void postConstruct(T instance);
/**
*
- * Calls the {@link jakarta.annotation.PreDestroy} callback, if it exists, according to the semantics required by the Java EE
+ * Calls the {@link jakarta.annotation.PreDestroy} callback, if it exists, according to the semantics required by the Java
+ * EE
* platform specification.
*
- *
+ *
* @param instance The instance on which to invoke the {@link jakarta.annotation.PreDestroy} method
*/
public void preDestroy(T instance);
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/InjectionTargetFactory.java b/api/src/main/java/jakarta/enterprise/inject/spi/InjectionTargetFactory.java
index 31c22402..a4a08d0a 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/InjectionTargetFactory.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/InjectionTargetFactory.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -22,29 +22,33 @@
*
* An {@link InjectionTargetFactory} can create an {@link InjectionTarget} for a given bean.
*
- *
+ *
*
- * The {@link InjectionTargetFactory} obtained from {@link BeanManager#getInjectionTargetFactory(AnnotatedType)} is capable of providing
+ * The {@link InjectionTargetFactory} obtained from {@link BeanManager#getInjectionTargetFactory(AnnotatedType)} is capable of
+ * providing
* container created injection targets. This factory can be wrapped to add behavior to container created injection targets.
*
CDI Lite implementations are not required to provide support for {@code InjectionTargetFactory}.
- *
+ *
+ * CDI Lite implementations are not required to provide support for {@code InjectionTargetFactory}.
+ *
+ *
* @author Pete Muir
* @author Antoine Sabot-Durand
* @since 1.1
@@ -55,7 +59,7 @@ public interface InjectionTargetFactory {
/**
* Create a new injection target for a bean.
- *
+ *
* @param bean the bean to create the injection target for, or null if creating a non-contextual object
* @return the injection target
*/
@@ -63,7 +67,8 @@ public interface InjectionTargetFactory {
/**
*
- * Returns an {@link AnnotatedTypeConfigurator} to to configure the {@link AnnotatedType} used to create the {@link InjectionTarget}.
+ * Returns an {@link AnnotatedTypeConfigurator} to to configure the {@link AnnotatedType} used to create the
+ * {@link InjectionTarget}.
*
* Each call returns the same AnnotatedTypeConfigurator.
*
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/InterceptionFactory.java b/api/src/main/java/jakarta/enterprise/inject/spi/InterceptionFactory.java
index b981f375..50baef83 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/InterceptionFactory.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/InterceptionFactory.java
@@ -37,8 +37,8 @@
*
* BeanManager bm;
*
- * public MyBean(BeanManager bm) {
- * this.bm = bm;
+ * public MyBean(BeanManager bm){
+ * this.bm=bm;
* }
*
* public MyClass create(CreationalContext<MyClass> creationalContext) {
@@ -73,7 +73,9 @@
* Instances of this class are neither reusable nor suitable for sharing between threads.
*
*
- *
CDI Lite implementations are not required to provide support for {@code InterceptionFactory}.
+ *
+ * CDI Lite implementations are not required to provide support for {@code InterceptionFactory}.
+ *
*
* @author Antoine Sabot-Durand
* @since 2.0
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/InterceptionType.java b/api/src/main/java/jakarta/enterprise/inject/spi/InterceptionType.java
index 93481957..1cf10cd4 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/InterceptionType.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/InterceptionType.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -20,10 +20,10 @@
*
* Identifies the kind of lifecycle callback, EJB timeout method or business method interception.
*
- *
+ *
* @author Gavin King
* @author Pete Muir
- *
+ *
*/
public enum InterceptionType {
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/Interceptor.java b/api/src/main/java/jakarta/enterprise/inject/spi/Interceptor.java
index ed2a3ac8..e4b9dea1 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/Interceptor.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/Interceptor.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -29,11 +29,11 @@
* Since CDI 2.0, an implementation of this interface may implement {@link Prioritized} in order to enable the interceptor with
* given priority value for entire application.
*
- *
+ *
* @author Gavin King
* @author Pete Muir
* @author David Allen
- *
+ *
* @param the interceptor bean class
*/
public interface Interceptor extends Bean {
@@ -42,7 +42,7 @@ public interface Interceptor extends Bean {
*
* Obtains the {@linkplain jakarta.interceptor.InterceptorBinding interceptor bindings} of the interceptor.
*
- *
+ *
* @return the set of {@linkplain jakarta.interceptor.InterceptorBinding interceptor bindings}
*/
public Set getInterceptorBindings();
@@ -52,7 +52,7 @@ public interface Interceptor extends Bean {
* Determines if the interceptor intercepts the specified {@linkplain InterceptionType kind of lifecycle callback or method
* invocation}.
*
- *
+ *
* @param type the {@linkplain InterceptionType kind of interception}
* @return returns true if the interceptor intercepts callbacks or business methods of the given type, and
* false otherwise.
@@ -64,7 +64,7 @@ public interface Interceptor extends Bean {
* Invokes the specified {@linkplain InterceptionType kind of lifecycle callback or method invocation interception} upon the
* given interceptor instance.
*
- *
+ *
* @param type the {@linkplain InterceptionType kind of interception}
* @param instance the interceptor instance to invoke
* @param ctx the context for the invocation
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ObserverMethod.java b/api/src/main/java/jakarta/enterprise/inject/spi/ObserverMethod.java
index ad57cbde..d69e1861 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/ObserverMethod.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/ObserverMethod.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -19,22 +19,22 @@
import java.lang.reflect.Type;
import java.util.Set;
+import jakarta.enterprise.event.Observes;
import jakarta.enterprise.event.ObservesAsync;
import jakarta.enterprise.event.Reception;
import jakarta.enterprise.event.TransactionPhase;
-import jakarta.enterprise.event.Observes;
/**
*
* Represents an {@linkplain Observes observer method} of an {@linkplain jakarta.enterprise.inject enabled
* bean}. Defines everything the container needs to know about an observer method.
*
- *
+ *
*
* If a custom implementation of this interface does not override either {@link #notify(Object)} or
* {@link #notify(EventContext)}, the container automatically detects the problem and treats it as a definition error.
*
- *
+ *
* @author Gavin King
* @author David Allen
* @author Mark Paluch
@@ -42,14 +42,14 @@
* @param the event type
*/
public interface ObserverMethod extends Prioritized {
-
+
public static final int DEFAULT_PRIORITY = jakarta.interceptor.Interceptor.Priority.APPLICATION + 500;
-
+
/**
*
* Obtains the {@linkplain Class class} of the type that declares the observer method.
*
- *
+ *
* @return the defining {@linkplain Class class}
*/
public Class> getBeanClass();
@@ -74,28 +74,28 @@ default Bean> getDeclaringBean() {
/**
* Obtains the {@linkplain jakarta.enterprise.event observed event type}.
- *
+ *
* @return the observed event {@linkplain Type type}
*/
public Type getObservedType();
/**
* Obtains the set of {@linkplain jakarta.enterprise.event observed event qualifiers}.
- *
+ *
* @return the observed event {@linkplain jakarta.inject.Qualifier qualifiers}
*/
public Set getObservedQualifiers();
/**
* Obtains the specified {@link Reception} for the observer method. This indicates if the observer is conditional or not.
- *
+ *
* @return the {@link Reception}
*/
public Reception getReception();
/**
* Obtains the specified {@link TransactionPhase} for the observer method.
- *
+ *
* @return the {@link TransactionPhase}
*/
public TransactionPhase getTransactionPhase();
@@ -117,17 +117,17 @@ public default int getPriority() {
*
* Calls the observer method, passing the given event object.
*
- *
+ *
*
* The implementation of this method for a custom observer method is responsible for deciding whether to call
* the method if the {@link #getReception()} returns {@link Reception#IF_EXISTS}.
*
- *
+ *
* @param event the event object
*/
public default void notify(T event) {
}
-
+
/**
* Calls the observer method, passing the given event context.
*
* The implementation of this method for a custom observer method is responsible for deciding whether to call the method if
* the {@link #getReception()} returns {@link Reception#IF_EXISTS}.
- *
+ *
* @param eventContext {@link EventContext} used to notify observers
*/
public default void notify(EventContext eventContext) {
@@ -144,12 +144,13 @@ public default void notify(EventContext eventContext) {
/**
*
- * Determines if this observer method is asynchronous
+ * Determines if this observer method is asynchronous
*
- *
- * @return returns true if the method is an asynchronous observer method (i.e. defined with {@link ObservesAsync}),
+ *
+ * @return returns true if the method is an asynchronous observer method (i.e. defined with
+ * {@link ObservesAsync}),
* otherwise returns false
- *
+ *
*/
public default boolean isAsync() {
return false;
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/PassivationCapable.java b/api/src/main/java/jakarta/enterprise/inject/spi/PassivationCapable.java
index 10b2fd89..e44afe8d 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/PassivationCapable.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/PassivationCapable.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -22,18 +22,20 @@
* Indicates that a custom implementation of {@link Bean} or
* {@link Contextual} is passivation capable.
*
- *
CDI Lite implementations are not required to provide support for passivation.
- *
+ *
+ * CDI Lite implementations are not required to provide support for passivation.
+ *
+ *
* @author Gavin King
* @author David Allen
- *
+ *
*/
public interface PassivationCapable {
/**
* A string that uniquely identifies the instance of {@link Bean} or
* {@link Contextual}. It is recommended that the string contain the package name of the class
* that implements {@code Bean} or {@code Contextual}.
- *
+ *
* @return a unique identifier for the {@link Bean} or
* {@link Contextual}
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/Prioritized.java b/api/src/main/java/jakarta/enterprise/inject/spi/Prioritized.java
index 3fbfe479..43fc9b25 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/Prioritized.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/Prioritized.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessAnnotatedType.java b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessAnnotatedType.java
index 9de807d2..19b0ef85 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessAnnotatedType.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessAnnotatedType.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -23,15 +23,17 @@
* the declared annotations.
*
*
- * Any observer of this event is permitted to wrap and/or replace the {@link AnnotatedType} by calling either {@link #setAnnotatedType(AnnotatedType)} or {@link #configureAnnotatedType()}.
+ * Any observer of this event is permitted to wrap and/or replace the {@link AnnotatedType} by calling either
+ * {@link #setAnnotatedType(AnnotatedType)} or {@link #configureAnnotatedType()}.
* If both methods are called within an observer notification an {@link IllegalStateException} is thrown.
- * The container must use the final value of this property, after all observers have been called, to discover the types and read the annotations of the program elements.
+ * The container must use the final value of this property, after all observers have been called, to discover the types and read
+ * the annotations of the program elements.
*
*
* For example, the following observer decorates the {@link AnnotatedType} for every class that is
* discovered by the container.
*
- *
+ *
*
* public <T> void decorateAnnotatedType(@Observes ProcessAnnotatedType<T> pat) {
* pat.setAnnotatedType(decorate(pat.getAnnotatedType()));
@@ -42,7 +44,9 @@
* error by the container.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @author David Allen
* @author Antoine Sabot-Durand
@@ -53,7 +57,7 @@ public interface ProcessAnnotatedType {
/**
* Returns the {@link AnnotatedType} object that will be used by the container to read the
* declared annotations.
- *
+ *
* @return the {@code AnnotatedType} object
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -61,7 +65,7 @@ public interface ProcessAnnotatedType {
/**
* Replaces the {@link AnnotatedType}.
- *
+ *
* @param type the new {@link AnnotatedType} object to use
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -81,6 +85,7 @@ public interface ProcessAnnotatedType {
/**
* Forces the container to ignore this type.
+ *
* @throws IllegalStateException if called outside of the observer method invocation
*/
public void veto();
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessBean.java b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessBean.java
index ca4aa4b4..125437e3 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessBean.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessBean.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -44,7 +44,9 @@
* the container.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @see Bean
* @author David Allen
@@ -56,11 +58,12 @@ public interface ProcessBean {
* Returns the {@link AnnotatedType} representing the bean class, the
* {@link AnnotatedMethod} representing the producer method, or the
* {@link AnnotatedField} representing the producer field.
- *
+ *
*
- * If invoked upon a {@link ProcessSyntheticBean} event, non-portable behavior results and the returned value should be ignored.
+ * If invoked upon a {@link ProcessSyntheticBean} event, non-portable behavior results and the returned value should be
+ * ignored.
*
- *
+ *
* @return the {@link Annotated} for the bean being registered
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -70,16 +73,16 @@ public interface ProcessBean {
* Returns the {@link Bean} object that is about to be registered. The
* {@link Bean} may implement {@link Interceptor} or
* {@link Decorator}.
- *
+ *
* @return the {@link Bean} object about to be registered
- * @throws IllegalStateException if called outside of the observer method invocation
+ * @throws IllegalStateException if called outside of the observer method invocation
*/
public Bean getBean();
/**
* Registers a definition error with the container, causing the container to abort deployment after bean discovery is
* complete.
- *
+ *
* @param t The definition error to register as a {@link java.lang.Throwable}
* @throws IllegalStateException if called outside of the observer method invocation
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessBeanAttributes.java b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessBeanAttributes.java
index f0766571..df503414 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessBeanAttributes.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessBeanAttributes.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -24,16 +24,20 @@
* registering the {@link Bean} object.
*
*
- * Any observer of this event is permitted to wrap and/or replace the {@link BeanAttributes} by calling either {@link #setBeanAttributes(BeanAttributes)} or {@link #configureBeanAttributes()}.
+ * Any observer of this event is permitted to wrap and/or replace the {@link BeanAttributes} by calling either
+ * {@link #setBeanAttributes(BeanAttributes)} or {@link #configureBeanAttributes()}.
* If both methods are called within an observer notification an {@link IllegalStateException} is thrown.
- * The container must use the final value of this property, after all observers have been called, to manage instances of the bean.
+ * The container must use the final value of this property, after all observers have been called, to manage instances of the
+ * bean.
*
*
* If any observer method of a {@code ProcessBeanAttributes} event throws an exception, the exception is treated as a definition
* error by the container.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @author Pete Muir
* @author Antoine Sabot-Durand
@@ -57,7 +61,7 @@ public interface ProcessBeanAttributes {
/**
* Replaces the {@link BeanAttributes}.
- *
+ *
* @param beanAttributes the new {@link BeanAttributes} to use
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -78,7 +82,7 @@ public interface ProcessBeanAttributes {
/**
* Registers a definition error with the container, causing the container to abort deployment after bean discovery is
* complete.
- *
+ *
* @param t the error to add
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -86,16 +90,20 @@ public interface ProcessBeanAttributes {
/**
* Forces the container to ignore the bean.
+ *
* @throws IllegalStateException if called outside of the observer method invocation
*/
public void veto();
-
/**
- *
Instructs the container to ignore all non-static, final methods with public, protected or default visibility
- * declared on any bean type of the specific bean during validation of injection points that require proxyable bean type.
+ *
+ * Instructs the container to ignore all non-static, final methods with public, protected or default visibility
+ * declared on any bean type of the specific bean during validation of injection points that require proxyable bean type.
+ *
*
- *
These method should never be invoked upon bean instances. Otherwise, unpredictable behavior results.
+ *
+ * These method should never be invoked upon bean instances. Otherwise, unpredictable behavior results.
+ *
*
*
* @throws IllegalStateException if called outside of the observer method invocation
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessInjectionPoint.java b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessInjectionPoint.java
index b919de6b..1da627ad 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessInjectionPoint.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessInjectionPoint.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -26,9 +26,11 @@
* decorator.
*
*
- * Any observer of this event is permitted to wrap and/or replace the {@link InjectionPoint} by calling either {@link #setInjectionPoint(InjectionPoint)} or {@link #configureInjectionPoint()}.
+ * Any observer of this event is permitted to wrap and/or replace the {@link InjectionPoint} by calling either
+ * {@link #setInjectionPoint(InjectionPoint)} or {@link #configureInjectionPoint()}.
* If both methods are called within an observer notification an {@link IllegalStateException} is thrown.
- * The container must use the final value of this property, after all observers have been called, he container must use the final
+ * The container must use the final value of this property, after all observers have been called, he container must use the
+ * final
* value of this property, after all observers have been called, whenever it performs injection upon the injection point.
*
*
@@ -36,7 +38,9 @@
* error by the container.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @see InjectionPoint
* @author Pete Muir
@@ -54,7 +58,7 @@ public interface ProcessInjectionPoint {
/**
* Replaces the InjectionPoint.
- *
+ *
* @param injectionPoint the new injection point
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -75,7 +79,7 @@ public interface ProcessInjectionPoint {
/**
* Registers a definition error with the container, causing the container to abort deployment after bean discovery is
* complete.
- *
+ *
* @param t the definition error
* @throws IllegalStateException if called outside of the observer method invocation
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessInjectionTarget.java b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessInjectionTarget.java
index 7be1e8b2..39d489e1 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessInjectionTarget.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessInjectionTarget.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -29,7 +29,7 @@
*
* For example, this observer decorates the {@code InjectionTarget} for all servlets.
*
- *
+ *
*
* public <T extends Servlet> void decorateServlet(@Observes ProcessInjectionTarget<T> pit) {
* pit.setInjectionTarget(decorate(pit.getInjectionTarget()));
@@ -40,7 +40,9 @@
* definition error by the container.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @see InjectionTarget
* @author David Allen
@@ -50,7 +52,7 @@ public interface ProcessInjectionTarget {
/**
* Returns the {@link AnnotatedType} representing the managed bean class, session bean class or
* other Java EE component class supporting injection.
- *
+ *
* @return the {@link AnnotatedType} of the bean with an injection target
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -59,7 +61,7 @@ public interface ProcessInjectionTarget {
/**
* Returns the {@link InjectionTarget} object that will be used by the container to perform
* injection.
- *
+ *
* @return the {@link InjectionTarget} object which performs the injection
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -67,7 +69,7 @@ public interface ProcessInjectionTarget {
/**
* Replaces the {@link InjectionTarget} which performs injection for this target.
- *
+ *
* @param injectionTarget The new {@link InjectionTarget} to use
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -76,7 +78,7 @@ public interface ProcessInjectionTarget {
/**
* Registers a definition error with the container, causing the container to abort deployment after bean discovery is
* complete.
- *
+ *
* @param t A {@link java.lang.Throwable} representing the definition error
* @throws IllegalStateException if called outside of the observer method invocation
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessManagedBean.java b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessManagedBean.java
index 9b10bd86..3fe223e2 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessManagedBean.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessManagedBean.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -28,7 +28,9 @@
* error by the container.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @author David Allen
* @param The class of the bean
@@ -36,7 +38,7 @@
public interface ProcessManagedBean extends ProcessBean {
/**
* Returns the {@link AnnotatedType} representing the bean class.
- *
+ *
* @return the {@link AnnotatedType} for the bean being registered
* @throws IllegalStateException if called outside of the observer method invocation
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessObserverMethod.java b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessObserverMethod.java
index b3c6589a..bc49c710 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessObserverMethod.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessObserverMethod.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -25,12 +25,15 @@
* enabled bean, before registering the {@link ObserverMethod} object.
*
*
- * For a custom implementation of {@link ObserverMethod}, the container must raise an event of type {@link ProcessSyntheticObserverMethod}.
+ * For a custom implementation of {@link ObserverMethod}, the container must raise an event of type
+ * {@link ProcessSyntheticObserverMethod}.
*
*
- * Any observer of this event is permitted to wrap and/or replace the {@link ObserverMethod} by calling either {@link #setObserverMethod(ObserverMethod)} or {@link #configureObserverMethod()}.
+ * Any observer of this event is permitted to wrap and/or replace the {@link ObserverMethod} by calling either
+ * {@link #setObserverMethod(ObserverMethod)} or {@link #configureObserverMethod()}.
* If both methods are called within an observer notification an {@link IllegalStateException} is thrown.
- * The container must use the final value of this property, after all observers have been called, he container must use the final
+ * The container must use the final value of this property, after all observers have been called, he container must use the
+ * final
* value of this property, after all observers have been called, whenever it performs observer resolution.
*
*
@@ -38,22 +41,25 @@
* error by the container.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @see ObserverMethod
* @author Gavin King
* @author David Allen
- * @author Antoine Sabot-Durand
+ * @author Antoine Sabot-Durand
* @param The type of the event being observed
* @param The bean type containing the observer method
*/
public interface ProcessObserverMethod {
-
+
/**
* The {@link AnnotatedMethod} representing the observer method.
- *
+ *
*
- * If invoked upon a {@link ProcessSyntheticObserverMethod} event, non-portable behavior results and the returned value should be ignored.
+ * If invoked upon a {@link ProcessSyntheticObserverMethod} event, non-portable behavior results and the returned value
+ * should be ignored.
*
*
* @return the {@link AnnotatedMethod} representing the observer method
@@ -74,7 +80,7 @@ public interface ProcessObserverMethod {
/**
* Registers a definition error with the container, causing the container to abort deployment after bean discovery is
* complete.
- *
+ *
* @param t A {@link java.lang.Throwable} representing the definition error
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -104,7 +110,7 @@ public interface ProcessObserverMethod {
/**
* Forces the container to ignore the observer method.
- *
+ *
* @throws IllegalStateException if called outside of the observer method invocation
* @since 2.0
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessProducer.java b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessProducer.java
index 3475d27e..167cff50 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessProducer.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessProducer.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -34,7 +34,7 @@
* For example, this observer decorates the {@code Producer} for the all producer methods and field of type
* {@code EntityManager}.
*
- *
+ *
*
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @see Producer
* @author David Allen
@@ -56,7 +58,7 @@ public interface ProcessProducer {
/**
* Returns the {@link AnnotatedField} representing the producer field or the
* {@link AnnotatedMethod} representing the producer method.
- *
+ *
* @return the {@link AnnotatedMember} representing the producer
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -65,7 +67,7 @@ public interface ProcessProducer {
/**
* Returns the {@link Producer} object that will be used by the container to call the producer
* method or read the producer field.
- *
+ *
* @return the {@link Producer} invoker object used by the container
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -74,20 +76,20 @@ public interface ProcessProducer {
/**
* Replaces the {@link Producer} object that will be used by the container to call the producer
* method or read the producer field.
- *
+ *
* @param producer the new {@link Producer} object to use
* @throws IllegalStateException if called outside of the observer method invocation
*/
public void setProducer(Producer producer);
-
+
/**
* Returns a {@link ProducerConfigurator} initialized with the {@link Producer} processed by this event, to configure a new
* {@link Producer} that will replace the original one at the end of the observer invocation.
- *
+ *
*
* Each call returns the same configurator instance within an observer notification.
*
- *
+ *
* @return a non reusable {@link ProducerConfigurator} to configure the original
* {@link Producer}.
* @throws IllegalStateException if called outside of the observer method invocation
@@ -98,7 +100,7 @@ public interface ProcessProducer {
/**
* Registers a definition error with the container, causing the container to abort deployment after bean discovery is
* complete.
- *
+ *
* @param t The definition error to register as a {@link java.lang.Throwable}
* @throws IllegalStateException if called outside of the observer method invocation
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessProducerField.java b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessProducerField.java
index 5d103f5f..11a172ea 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessProducerField.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessProducerField.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -25,17 +25,19 @@
* error by the container.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @author David Allen
* @param The type of the producer field
* @param The class of the bean declaring the producer field
- *
+ *
*/
public interface ProcessProducerField extends ProcessBean {
/**
* Returns the {@link AnnotatedField} representing the producer field.
- *
+ *
* @return the {@link AnnotatedField} for the producer field being registered
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -44,7 +46,7 @@ public interface ProcessProducerField extends ProcessBean {
/**
* Returns the {@link AnnotatedParameter} for any matching injection point of the same type as
* the producer field return type found on a disposal method.
- *
+ *
* @return the disposal method's {@link AnnotatedParameter}
* @throws IllegalStateException if called outside of the observer method invocation
* @since 1.1
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessProducerMethod.java b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessProducerMethod.java
index 2fcade8d..1d0cd287 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessProducerMethod.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessProducerMethod.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -25,7 +25,9 @@
* error by the container.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @author David Allen
* @param The return type of the producer method
@@ -34,7 +36,7 @@
public interface ProcessProducerMethod extends ProcessBean {
/**
* Returns the {@link AnnotatedMethod} representing the producer method.
- *
+ *
* @return the {@link AnnotatedMethod} for the producer method being registered
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -43,7 +45,7 @@ public interface ProcessProducerMethod extends ProcessBean {
/**
* Returns the {@link AnnotatedParameter} for any matching injection point of the same type as
* the producer method return type found on a disposal method.
- *
+ *
* @return the disposal method's {@link AnnotatedParameter}
* @throws IllegalStateException if called outside of the observer method invocation
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessSessionBean.java b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessSessionBean.java
index 531f1846..7f1a93aa 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessSessionBean.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessSessionBean.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -21,27 +21,29 @@
* The container fires an event of this type for each enabled session bean, before registering the
* {@link Bean} object.
*
- *
+ *
*
* If any observer method of a {@code ProcessSessionBean} event throws an exception, the exception is treated as a definition
* error by the container.
*
- *
+ *
*
* Note that the type parameter of the super-interface of {@link ProcessSessionBean} is {@link Object} as {@link ProcessBean}
* allows you access to the {@link Bean}, which in turn allows you to instantiate an instance, which, for interface-view EJBs
* will not be an instance of X.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
- *
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ *
* @author David Allen
* @param session bean type
*/
public interface ProcessSessionBean extends ProcessManagedBean {
/**
* Returns the EJB name of the session bean.
- *
+ *
* @return the name of the EJB
* @throws IllegalStateException if called outside of the observer method invocation
*/
@@ -49,7 +51,7 @@ public interface ProcessSessionBean extends ProcessManagedBean {
/**
* Returns a {@link SessionBeanType} representing the kind of session bean.
- *
+ *
* @return the {@link SessionBeanType}
* @throws IllegalStateException if called outside of the observer method invocation
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessSyntheticAnnotatedType.java b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessSyntheticAnnotatedType.java
index 02b071f5..b9fa0580 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessSyntheticAnnotatedType.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessSyntheticAnnotatedType.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -31,7 +31,7 @@
* For example, the following observer decorates the {@link AnnotatedType} for every class that is
* added by {@link BeforeBeanDiscovery#addAnnotatedType(AnnotatedType, String)}.
*
- *
+ *
*
* public <T> void decorateAnnotatedType(@Observes ProcessSyntheticAnnotatedType<T> pat) {
* pat.setAnnotatedType(decorate(pat.getAnnotatedType()));
@@ -42,7 +42,9 @@
* definition error by the container.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @author David Allen
* @author Pete Muir
@@ -54,7 +56,7 @@
public interface ProcessSyntheticAnnotatedType extends ProcessAnnotatedType {
/**
* Get the extension instance which added the {@link AnnotatedType} for which this event is being fired.
- *
+ *
* @return the extension instance
* @throws IllegalStateException if called outside of the observer method invocation
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessSyntheticBean.java b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessSyntheticBean.java
index ecf68a3b..7bb8f828 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessSyntheticBean.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessSyntheticBean.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -26,7 +26,9 @@
* error by the container.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @author Martin Kouba
* @param The class of the bean
@@ -36,7 +38,7 @@ public interface ProcessSyntheticBean extends ProcessBean {
/**
* Get the extension instance which added the {@link Bean} for which this event is being fired.
- *
+ *
* @return the extension instance
* @throws IllegalStateException if called outside of the observer method invocation
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessSyntheticObserverMethod.java b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessSyntheticObserverMethod.java
index f8b53b83..0fd4bb6b 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/ProcessSyntheticObserverMethod.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/ProcessSyntheticObserverMethod.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -23,11 +23,14 @@
* registering the {@link ObserverMethod} object.
*
*
- * If any observer method of a {@code ProcessSyntheticObserverMethod} event throws an exception, the exception is treated as a definition
+ * If any observer method of a {@code ProcessSyntheticObserverMethod} event throws an exception, the exception is treated as a
+ * definition
* error by the container.
*
*
- *
CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
+ * CDI Lite implementations are not required to provide support for Portable Extensions.
+ *
*
* @see ObserverMethod
* @author Martin Kouba
@@ -39,7 +42,7 @@ public interface ProcessSyntheticObserverMethod extends ProcessObserverMet
/**
* Get the extension instance which added the {@link ObserverMethod} for which this event is being fired.
- *
+ *
* @return the extension instance
* @throws IllegalStateException if called outside of the observer method invocation
*/
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/Producer.java b/api/src/main/java/jakarta/enterprise/inject/spi/Producer.java
index 7d3a438d..0b2a3b73 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/Producer.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/Producer.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -24,8 +24,10 @@
* Provides a generic operation for producing an instance of a type.
*
*
- *
CDI Lite implementations are not required to provide support for {@code Producer}.
- *
+ *
+ * CDI Lite implementations are not required to provide support for {@code Producer}.
+ *
+ *
* @author Pete Muir
* @author David Allen
* @param The class of object produced by the producer
@@ -36,15 +38,17 @@ public interface Producer {
* Causes an instance to be produced via the {@code Producer}.
*
*
- * If the {@code Producer} represents a class, this will invoke the constructor annotated {@link jakarta.inject.Inject} if it
- * exists, or the constructor with no parameters otherwise. If the class has interceptors, produce() is responsible
+ * If the {@code Producer} represents a class, this will invoke the constructor annotated {@link jakarta.inject.Inject} if
+ * it
+ * exists, or the constructor with no parameters otherwise. If the class has interceptors, produce() is
+ * responsible
* for building the interceptors and decorators of the instance.
*
*
* If the {@code Producer} represents a producer field or method, this will invoke the producer method on, or access the
* producer field of, a contextual instance of the bean that declares the producer.
*
- *
+ *
* @param ctx The {@link CreationalContext} to use for the produced object
* @return the instance produced
*/
@@ -62,7 +66,7 @@ public interface Producer {
* instance of the bean that declares the disposer method or performs any additional required cleanup, if any, to destroy
* state associated with a resource.
*
- *
+ *
* @param instance The instance to dispose
*/
public void dispose(T instance);
@@ -74,7 +78,7 @@ public interface Producer {
* method parameters. For a producer method, this returns the set of {@code InjectionPoint} objects representing all
* parameters of the producer method.
*
- *
+ *
* @return the set of all {@linkplain InjectionPoint injection points} for the producer
*/
public Set getInjectionPoints();
diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ProducerFactory.java b/api/src/main/java/jakarta/enterprise/inject/spi/ProducerFactory.java
index 94f3229d..bb790af0 100644
--- a/api/src/main/java/jakarta/enterprise/inject/spi/ProducerFactory.java
+++ b/api/src/main/java/jakarta/enterprise/inject/spi/ProducerFactory.java
@@ -8,7 +8,7 @@
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -20,29 +20,31 @@
*
* An {@link ProducerFactory} can create an {@link Producer} for a given bean.
*
- *
+ *
*
* The {@link ProducerFactory} obtained from {@link BeanManager#getProducerFactory(AnnotatedMethod, Bean)} or
* {@link BeanManager#getProducerFactory(AnnotatedField, Bean)} is capable of providing container created
* producers. This factory can be wrapped to add behavior to container created producers.
*