Skip to content

Commit

Permalink
Describe in more depth what kind of interception is supported in Lite.
Browse files Browse the repository at this point in the history
  • Loading branch information
manovotn committed Oct 25, 2021
1 parent 356ae28 commit 1563b55
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
2 changes: 1 addition & 1 deletion spec/src/main/asciidoc/cdi-spec.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 11 additions & 3 deletions spec/src/main/asciidoc/core/interceptors.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<interceptors_full>>.

[[interceptor_bindings]]

Expand Down
11 changes: 10 additions & 1 deletion spec/src/main/asciidoc/core/interceptors_full.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@

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,
* declaring `@AroundInvoke` interceptor methods on _target classes_ (i.e. on beans).

Furthermore, {cdi_full} implementations are required to support additional features, including:

* custom implementations of `Interceptor`,
* usage of `InterceptionFactory` as described in <<interception_factory>>,
* enablement and ordering of interceptors per bean archive via `beans.xml` as described in <<enabled_interceptors>>.

[[binding_interceptor_to_bean_full]]

Expand Down

0 comments on commit 1563b55

Please sign in to comment.