Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Describe in more depth what kind of interception is supported in Lite. #548

Merged
merged 1 commit into from
Oct 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
manovotn marked this conversation as resolved.
Show resolved Hide resolved
{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