From f3c16f3a3dd1153644a131048b2713e53e55c4eb Mon Sep 17 00:00:00 2001 From: Ladislav Thon Date: Thu, 5 Jan 2023 10:19:18 +0100 Subject: [PATCH 1/5] Fix remnants of BeanManager.fireEvent() removal --- .../java/jakarta/enterprise/inject/spi/EventMetadata.java | 3 +-- spec/src/main/asciidoc/core/events.asciidoc | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) 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. *

*

* {@link EventMetadata} may only be injected into an observer method. For example: 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]] From b39c774ee481d401b72f4ba50978f8ca408ca174 Mon Sep 17 00:00:00 2001 From: Ladislav Thon Date: Thu, 5 Jan 2023 10:33:30 +0100 Subject: [PATCH 2/5] Centralize common Maven properties in the parent POM --- api/pom.xml | 21 ++++++++------------- lang-model/pom.xml | 15 ++++----------- pom.xml | 10 ++++++++++ 3 files changed, 22 insertions(+), 24 deletions(-) diff --git a/api/pom.xml b/api/pom.xml index ffcf534e..62c41ee4 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -128,12 +128,6 @@ 2.0.1 5.0.0 2.1.0 - - 11 - 5.1.2 - 3.3.0 - 3.0.0-M5 - UTF-8 @@ -289,8 +283,9 @@ + org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + ${maven-compiler-plugin.version} -Xlint:all @@ -328,7 +323,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.2.0 + ${maven-jar-plugin.version} ${project.build.outputDirectory}/META-INF/MANIFEST.MF @@ -375,14 +370,14 @@ org.apache.maven.plugins maven-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 API false - 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/lang-model/pom.xml b/lang-model/pom.xml index a7764cf1..fdfc7038 100644 --- a/lang-model/pom.xml +++ b/lang-model/pom.xml @@ -21,14 +21,6 @@ - - 11 - 5.1.2 - 3.2.0 - 2.22.0 - UTF-8 - - @@ -46,8 +38,9 @@ + org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + ${maven-compiler-plugin.version} -Xlint:all @@ -79,7 +72,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.2.0 + ${maven-jar-plugin.version} ${project.build.outputDirectory}/META-INF/MANIFEST.MF @@ -89,7 +82,7 @@ org.apache.maven.plugins maven-javadoc-plugin - ${maven-javadoc-plugin} + ${maven-javadoc-plugin.version} true Jakarta CDI Language Model diff --git a/pom.xml b/pom.xml index 2c09af90..49217a51 100644 --- a/pom.xml +++ b/pom.xml @@ -39,6 +39,16 @@ + 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/ From 02e52a9f03ac08a3df9f7d3a33fbd4f402559541 Mon Sep 17 00:00:00 2001 From: Ladislav Thon Date: Wed, 24 May 2023 12:41:30 +0200 Subject: [PATCH 3/5] Fix EL import version in bundle metadata --- api/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/pom.xml b/api/pom.xml index 62c41ee4..7acf54d9 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -313,7 +313,7 @@ jakarta.enterprise.*;version=4.0, - jakarta.el; version=4.0, + jakarta.el;version=5.0, * From 0c4b3c0379ac67c0c6ff048e6b628fc8a4059787 Mon Sep 17 00:00:00 2001 From: Ladislav Thon Date: Thu, 5 Jan 2023 10:42:00 +0100 Subject: [PATCH 4/5] Bump CDI version to 4.1 --- api/pom.xml | 6 +++--- lang-model/pom.xml | 4 ++-- pom.xml | 2 +- spec/pom.xml | 2 +- spec/src/main/asciidoc/cdi-spec.asciidoc | 4 ++-- spec/src/main/asciidoc/preface.asciidoc | 4 +++- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/api/pom.xml b/api/pom.xml index 7acf54d9..94405952 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -21,7 +21,7 @@ jakarta.enterprise jakarta.enterprise.cdi-parent - 4.0.2-SNAPSHOT + 4.1.0-SNAPSHOT jakarta.enterprise.cdi-api @@ -309,8 +309,8 @@ 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=5.0, diff --git a/lang-model/pom.xml b/lang-model/pom.xml index fdfc7038..8a580e4d 100644 --- a/lang-model/pom.xml +++ b/lang-model/pom.xml @@ -4,7 +4,7 @@ jakarta.enterprise jakarta.enterprise.cdi-parent - 4.0.2-SNAPSHOT + 4.1.0-SNAPSHOT jakarta.enterprise.lang-model @@ -63,7 +63,7 @@ - jakarta.enterprise.lang.model.*;version=4.0, + jakarta.enterprise.lang.model.*;version=4.1, diff --git a/pom.xml b/pom.xml index 49217a51..6e9fe5cb 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ jakarta.enterprise jakarta.enterprise.cdi-parent pom - 4.0.2-SNAPSHOT + 4.1.0-SNAPSHOT Parent module for CDI Specification 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.enterprise jakarta.enterprise.cdi-parent - 4.0.2-SNAPSHOT + 4.1.0-SNAPSHOT jakarta.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/preface.asciidoc b/spec/src/main/asciidoc/preface.asciidoc index d14a4b77..2ed80d3d 100644 --- a/spec/src/main/asciidoc/preface.asciidoc +++ b/spec/src/main/asciidoc/preface.asciidoc @@ -24,6 +24,8 @@ This document is organized in 4 parts: === Major changes +==== Jakarta Contexts and Dependency Injection 4.1 + ==== 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 +88,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 a4190e0f9bf69fa2d904a245b4c19b1f6e387ea7 Mon Sep 17 00:00:00 2001 From: Ladislav Thon Date: Wed, 24 May 2023 12:37:15 +0200 Subject: [PATCH 5/5] Place the EL integration API to ELAwareBeanManager in a new supplemental API artifact The existing EL integration API in `BeanManager` is deprecated for removal. --- .../enterprise/inject/spi/BeanManager.java | 7 +- 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 ++ pom.xml | 1 + 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 | 3 + 14 files changed, 328 insertions(+), 35 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/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/el/pom.xml b/el/pom.xml new file mode 100644 index 00000000..a724101c --- /dev/null +++ b/el/pom.xml @@ -0,0 +1,147 @@ + + 4.0.0 + + + jakarta.enterprise + jakarta.enterprise.cdi-parent + 4.1.0-SNAPSHOT + + + jakarta.enterprise.cdi-el-api + jar + + CDI EL integration API + API for integrating CDI with Unified EL + + + + Apache License 2.0 + https://repository.jboss.org/licenses/apache-2.0.txt + repo + + + + + 5.0.0 + + + + + + jakarta.enterprise + jakarta.enterprise.cdi-api + ${project.version} + + + jakarta.el + jakarta.el-api + ${uel.api.version} + + + + + + + jakarta.enterprise + jakarta.enterprise.cdi-api + + + + jakarta.el + jakarta.el-api + + + + + + + ${project.basedir}/.. + + LICENSE.txt + NOTICE.md + + META-INF + + + src/main/resources + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + + -Xlint:all + + + + + org.apache.felix + maven-bundle-plugin + ${maven-bundle-plugin.version} + + + bundle-manifest + process-classes + + manifest + + + + + + + jakarta.enterprise.inject.spi.el;version=4.1, + + + jakarta.el;version=5.0 + + + + + + + org.apache.maven.plugins + maven-jar-plugin + ${maven-jar-plugin.version} + + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + + org.apache.maven.plugins + maven-javadoc-plugin + ${maven-javadoc-plugin.version} + + true + Jakarta CDI EL integration API + Jakarta CDI EL integration API + Jakarta CDI EL integration API +
Jakarta CDI EL integration API ${project.version}]]> +
+ cdi-dev@eclipse.org.
+Copyright © 2018,2020 Eclipse Foundation.
+Use is subject to license terms.]]> +
+
+ + + + attach-javadocs + + jar + + + +
+
+
+ + +
diff --git a/el/src/main/java/jakarta/enterprise/inject/spi/el/ELAwareBeanManager.java b/el/src/main/java/jakarta/enterprise/inject/spi/el/ELAwareBeanManager.java new file mode 100644 index 00000000..8fa8e475 --- /dev/null +++ b/el/src/main/java/jakarta/enterprise/inject/spi/el/ELAwareBeanManager.java @@ -0,0 +1,34 @@ +package jakarta.enterprise.inject.spi.el; + +import jakarta.el.ELResolver; +import jakarta.el.ExpressionFactory; +import jakarta.enterprise.context.Dependent; +import jakarta.enterprise.inject.spi.BeanManager; + +/** + * A {@link BeanManager} that allows integrators to obtain Unified EL objects + * that are integrated with the CDI container as described in the CDI specification. + * + * @since 4.1 + */ +public interface ELAwareBeanManager extends BeanManager { + /** + * Returns a {@link jakarta.el.ELResolver} that resolves beans by EL name. + * + * @return the {@link jakarta.el.ELResolver} + */ + public ELResolver getELResolver(); + + /** + * 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 + * 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}. + * + * @param expressionFactory the {@link jakarta.el.ExpressionFactory} to wrap + * @return the wrapped {@link jakarta.el.ExpressionFactory} + */ + public ExpressionFactory wrapExpressionFactory(ExpressionFactory expressionFactory); + +} diff --git a/el/src/main/java/module-info.java b/el/src/main/java/module-info.java new file mode 100644 index 00000000..61de99b2 --- /dev/null +++ b/el/src/main/java/module-info.java @@ -0,0 +1,6 @@ +module jakarta.cdi.el { + exports jakarta.enterprise.inject.spi.el; + + requires transitive jakarta.cdi; + requires transitive jakarta.el; +} diff --git a/el/src/main/javadoc/doc-files/speclicense.html b/el/src/main/javadoc/doc-files/speclicense.html new file mode 100644 index 00000000..40691a7a --- /dev/null +++ b/el/src/main/javadoc/doc-files/speclicense.html @@ -0,0 +1,72 @@ + + + Eclipse Foundation Specification License - v1.0 + + +

Eclipse Foundation Specification License - v1.0

+

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.
  • +
  • All existing copyright notices, or if one does not exist, a notice + (hypertext is preferred, but a textual representation is permitted) + of the form: "Copyright © [$date-of-document] + “Eclipse Foundation, Inc. <<url to this license>> + " +
  • +
+ +

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.

+ +

The notice is:

+ +

"Copyright © 2018 Eclipse Foundation. This software or + document includes material copied from or derived from [title and URI + of the Eclipse Foundation specification document]."

+ +

Disclaimers

+ +

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/pom.xml b/pom.xml index 6e9fe5cb..f196ef19 100644 --- a/pom.xml +++ b/pom.xml @@ -33,6 +33,7 @@ spec lang-model api + el clean package 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 2ed80d3d..233a74e5 100644 --- a/spec/src/main/asciidoc/preface.asciidoc +++ b/spec/src/main/asciidoc/preface.asciidoc @@ -26,6 +26,9 @@ This document is organized in 4 parts: ==== 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.