From c7598fb1e5e3e3de60cf067586e8f4449f5c8655 Mon Sep 17 00:00:00 2001 From: Matej Novotny Date: Mon, 25 Oct 2021 09:39:51 +0200 Subject: [PATCH] Describe in more depth what kind of interception is supported in Lite. --- spec/src/main/asciidoc/cdi-spec.asciidoc | 2 +- spec/src/main/asciidoc/core/interceptors.asciidoc | 14 +++++++++++--- .../main/asciidoc/core/interceptors_full.asciidoc | 8 +++++++- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/spec/src/main/asciidoc/cdi-spec.asciidoc b/spec/src/main/asciidoc/cdi-spec.asciidoc index 2913bf8e..12a61d41 100644 --- a/spec/src/main/asciidoc/cdi-spec.asciidoc +++ b/spec/src/main/asciidoc/cdi-spec.asciidoc @@ -57,7 +57,7 @@ include::core/beanmanager_lite.asciidoc[] include::core/spi_lite.asciidoc[] -include::core/packagingdeployment_lite.asciidoc[] +include::core/packagingdeployment.asciidoc[] :leveloffset: -1 diff --git a/spec/src/main/asciidoc/core/interceptors.asciidoc b/spec/src/main/asciidoc/core/interceptors.asciidoc index 77f96fb8..707af07f 100644 --- a/spec/src/main/asciidoc/core/interceptors.asciidoc +++ b/spec/src/main/asciidoc/core/interceptors.asciidoc @@ -5,10 +5,18 @@ Managed beans support interception. _Interceptors_ are used to separate cross-cutting concerns from business logic. The Jakarta Interceptors specification defines the basic programming model and semantics, and how to associate interceptors with target classes. -This specification defines various extensions to the Java Interceptors specification, including non-binding annotation values in interceptor resolution. +This specification defines an extent to which {cdi_lite} supports Jakarta Interceptors specification, including extending it with non-binding annotation values in interceptor resolution. -{cdi_lite} implementations are not required to support associating interceptors with classes and methods using the `@jakarta.interceptor.Interceptors` annotation. -They are required to support interceptor binding annotations. +{cdi_lite} implementations are required to support following forms of interception: + +* Interceptors declared on interceptor classes and associated with target class using interceptor binding annotations +** `@AroundInvoke`, `@PostConstruct`, `@PreDestroy` and `@AroundConstruct` are all supported +* Enablement and ordering of interceptors using `@Priority` annotation +* * `@PostConstruct` and `@PreDestroy` declared on target class (i.e. on a bean) + +Using other forms of interception results in non-portable behavior. + +{cdi_full} implementations are required to support all forms of interception, as described in <>. [[interceptor_bindings]] diff --git a/spec/src/main/asciidoc/core/interceptors_full.asciidoc b/spec/src/main/asciidoc/core/interceptors_full.asciidoc index fd6b4fd3..fa63d980 100644 --- a/spec/src/main/asciidoc/core/interceptors_full.asciidoc +++ b/spec/src/main/asciidoc/core/interceptors_full.asciidoc @@ -4,7 +4,13 @@ This specification defines various extensions to the Jakarta Interceptors specification, including how to override the interceptor order defined by the `@Priority` annotation. -{cdi_full} implementations are required to support the entire Jakarta Interceptors specification, including associating interceptors with classes and methods using the `@jakarta.interceptor.Interceptors` annotation. +{cdi_full} implementations are required to support the entire Jakarta Interceptors specification, including: + +* Associating interceptors with classes and methods using the `@jakarta.interceptor.Interceptors` annotation. +* Declaration of `@AroundInvoke` interceptor methods on _target classes_ (i.e. on beans) +* Custom implementations of `Interceptor` +* Usage of `InterceptionFactory` as described in <> +* Enablement and ordering of interceptors per bean archive via `beans.xml` as described in <> [[binding_interceptor_to_bean_full]]