From 03450e0e30ef0dcd010d053179dd5f55a365eaa7 Mon Sep 17 00:00:00 2001 From: Antoine Sabot-Durand Date: Tue, 25 Feb 2014 18:11:51 +0100 Subject: [PATCH] CDI-377 automatic JSR-330 annotation processing problematic Modification of bean definition annotation to exclude JSR-330 scopes types adding Stereotypes, Decorators and Interceptors --- spec/src/main/doc/definition.asciidoc | 14 ++++++++++++-- spec/src/main/doc/packagingdeployment.asciidoc | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/spec/src/main/doc/definition.asciidoc b/spec/src/main/doc/definition.asciidoc index dfd5ce210..13d229d0e 100644 --- a/spec/src/main/doc/definition.asciidoc +++ b/spec/src/main/doc/definition.asciidoc @@ -500,9 +500,17 @@ If a bean explicitly declares a scope, any default scopes declared by stereotype === Bean defining annotations -A bean class may have a _bean defining annotation_, allowing it to be placed anywhere in an application, as defined in <>. +A bean class may have a _bean defining annotation_, allowing it to be placed anywhere in an application, as defined in <>. A bean class with a _bean defining annotation_ is said to be an _implicit bean_. -Any scope type is a bean defining annotation. If a scope type is declared on a bean class, then the bean class is said to have a bean defining annotation. For example, this dependent scoped bean has a bean defining annotation: +The set of bean defining annotations contains : + +* `@ApplicationScoped`, `@SessionScoped`, `@ConversationScoped` and `@RequestScoped` annotations, +* all others normal scope types, +* `@Interceptor` and `@Decorator` annotations, +* all stereotypes annotations (i.e. annotations annotated with `@Stereotype`), +* and the `@Dependent` scope annotation. + +If one of these annotations is declared on a bean class, then the bean class is said to have a bean defining annotation. For example, this dependent scoped bean has a bean defining annotation: [source,java] ---- @@ -525,6 +533,8 @@ public class CoffeeShop } ---- +Note that to ensure compatibility with other JSR-330 implementations, all pseudo-scopes annotations except `@Dependent` *are not* bean defining annotations. However a stereotype annotation including a pseudo-scope annotation *is* a bean defining annotation. + [[names]] === Bean names diff --git a/spec/src/main/doc/packagingdeployment.asciidoc b/spec/src/main/doc/packagingdeployment.asciidoc index 4e6b9a39a..dee1f1b4a 100644 --- a/spec/src/main/doc/packagingdeployment.asciidoc +++ b/spec/src/main/doc/packagingdeployment.asciidoc @@ -34,7 +34,7 @@ An _explicit bean archive_ is an archive which contains a +beans.xml+ file: * with no version number, or, * that is an empty file. -An _implicit bean archive_ is any other archive which contains one or more bean classes with a bean defining annotation, or one or more session beans. +An _implicit bean archive_ is any other archive which contains one or more bean classes with a bean defining annotation as defined in <>, or one or more session beans. When determining which archives are bean archives, the container must consider: