Skip to content

Commit a7a8c9e

Browse files
committed
ArC: document the strict mode in the CDI reference guide
1 parent 61eacfc commit a7a8c9e

File tree

1 file changed

+31
-3
lines changed

1 file changed

+31
-3
lines changed

docs/src/main/asciidoc/cdi-reference.adoc

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ include::_attributes.adoc[]
1111
:sectnums:
1212
:sectnumlevels: 4
1313

14-
Quarkus DI solution (also called ArC) is based on the https://jakarta.ee/specifications/cdi/2.0/cdi-spec-2.0.html[Contexts and Dependency Injection for Java 2.0, window="_blank"] specification.
15-
However, it is not a full CDI implementation verified by the TCK.
16-
Only a subset of the CDI features is implemented - see also <<supported_features,the list of supported features>> and <<limitations,the list of limitations>>.
14+
Quarkus DI solution (also called ArC) is based on the https://jakarta.ee/specifications/cdi/4.0/jakarta-cdi-spec-4.0.html[Jakarta Contexts and Dependency Injection 4.0, window="_blank"] specification.
15+
It aims to implement the CDI Lite specification, with selected improvements on top.
16+
It is not a CDI Full implementation and is not verified by the TCK yet.
17+
See also <<supported_features,the list of supported features>> and <<limitations,the list of limitations>>.
1718
1819
TIP: If you're new to CDI then we recommend you to read the xref:cdi.adoc[Introduction to CDI] first.
1920
@@ -741,6 +742,7 @@ class Services {
741742
+
742743
NOTE: Interceptors can use `InvocationContext.getMethod()` to detect static methods and adjust the behavior accordingly.
743744

745+
[[unproxyable_classes_transformation]]
744746
=== Ability to handle 'final' classes and methods
745747

746748
In normal CDI, classes that are marked as `final` and / or have `final` methods are not eligible for proxy creation,
@@ -1081,6 +1083,32 @@ NOTE: These endpoints are only available in the development mode, i.e. when you
10811083
In the development mode, it is also possible to enable monitoring of business method invocations and fired events.
10821084
Simply set the `quarkus.arc.dev-mode.monitoring-enabled` configuration property to `true` and explore the relevant Dev UI pages.
10831085

1086+
[[strict_mode]]
1087+
== Strict Mode
1088+
1089+
By default, ArC does not perform all validations required by the CDI specification.
1090+
It also improves CDI usability in many ways, some of them being directly against the specification.
1091+
1092+
To be able to eventually pass the CDI Lite TCK, ArC also has a _strict_ mode.
1093+
This mode enables additional validations and disables certain improvements that conflict with the specification.
1094+
1095+
To enable the strict mode, use the following configuration:
1096+
1097+
[source,properties]
1098+
----
1099+
quarkus.arc.strict-compatibility=true
1100+
----
1101+
1102+
Some other features affect specification compatibility as well:
1103+
1104+
* <<unproxyable_classes_transformation,Transformation of unproxyable classes>>
1105+
* <<remove_unused_beans,Unused beans removal>>
1106+
1107+
To get a behavior closer to the specification, these features should also be disabled.
1108+
1109+
Applications are recommended to use the default, non-strict mode, which makes CDI more convenient to use.
1110+
The "strictness" of the strict mode (the set of additional validations and the set of disabled improvements on top of the CDI specification) may change over time.
1111+
10841112
[[arc-configuration-reference]]
10851113
== ArC Configuration Reference
10861114

0 commit comments

Comments
 (0)