From 204f03fa3beeb480dbf1f0595a61b1a5992a8b4a Mon Sep 17 00:00:00 2001 From: Scott M Stark Date: Wed, 29 Nov 2023 16:38:34 -0600 Subject: [PATCH 1/2] 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 | 2 +- spec/src/main/asciidoc/core/lifecycle.asciidoc | 4 ++-- 3 files changed, 4 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..d08efbff 100644 --- a/spec/src/main/asciidoc/core/implementation.asciidoc +++ b/spec/src/main/asciidoc/core/implementation.asciidoc @@ -18,7 +18,7 @@ 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. +The basic lifecycle and semantics of managed beans are defined by the CDI 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..11e1bca0 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, as defined by this specification, 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, as defined by this specification, and any dependent objects, as defined in <>. From e24bb0ea10da2c8d5ce788ad539537f6410d0623 Mon Sep 17 00:00:00 2001 From: Scott M Stark Date: Thu, 30 Nov 2023 11:20:28 -0600 Subject: [PATCH 2/2] + Updates for PR feedback Signed-off-by: Scott M Stark --- spec/src/main/asciidoc/core/implementation.asciidoc | 1 - spec/src/main/asciidoc/core/lifecycle.asciidoc | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/spec/src/main/asciidoc/core/implementation.asciidoc b/spec/src/main/asciidoc/core/implementation.asciidoc index d08efbff..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 CDI 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 11e1bca0..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 this 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 this 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 <>.