From 4fe7cd4d6a88487006af9abff66e89995aff0951 Mon Sep 17 00:00:00 2001 From: Maxim Nesen Date: Wed, 6 Oct 2021 20:18:28 +0200 Subject: [PATCH 1/2] Documentation for Feature and Dynamic Feature enchansments Signed-off-by: Maxim Nesen --- docs/src/main/docbook/deployment.xml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/src/main/docbook/deployment.xml b/docs/src/main/docbook/deployment.xml index 474fd6392e..8fe8970850 100644 --- a/docs/src/main/docbook/deployment.xml +++ b/docs/src/main/docbook/deployment.xml @@ -110,6 +110,9 @@ classpath, unless explicitly stated otherwise in the documentation of each particular extension. Users are expected to explicitly register the extension &jaxrs.core.Feature;s using their &lit.jaxrs.core.Application; subclass. + Since Jersey 3.1.0 all features which extends &jaxrs.core.Feature; and are listed as SPI of the &lit.jaxrs.core.Feature; + interface are automatically registered (not required to be registered within &lit.jaxrs.core.Application; subclass). + For server site Jersey 3.1.0 also registers SPIs for &lit.jaxrs.container.DynamicFeature; interface. For a few Jersey provided modules however there is no need to explicitly register their extension &lit.jaxrs.core.Feature;s as these are discovered and registered in the &jaxrs.core.Configuration; (on client/server) automatically by Jersey runtime whenever the modules implementing these features are present on the classpath @@ -193,6 +196,17 @@ +
+ Feature and Dynamic Feature SPI automatic registration + + Since Jersey 3.1.0 there is new specification requirement to automatically discover and register classes which + implement &jaxrs.core.Feature; and &jaxrs.container.DynamicFeature; interfaces. This is being done via SPI search + thus all those classes in order to be discovered automatically shall be listed as SPIs for given interfaces. + This automatic registration can also be disabled by jakarta.ws.rs.loadServices + (which is new specification property) to be set to false. This is also valid for + &jersey.common.CommonProperties.FEATURE_AUTO_DISCOVERY_DISABLE; lookup . + +
Configuring the Classpath Scanning @@ -206,6 +220,12 @@ List of SPIs recognized by Jersey + + &lit.jaxrs.core.Feature; (server, client) - + Features are being registered similarly as AutoDiscoverable feature. In addition + property jakarta.ws.rs.loadServices is checked before registration. + + AutoDiscoverable (server, client) - it means if you disable service loading the AutoDiscoverable feature is automatically disabled too @@ -217,6 +237,10 @@ HeaderDelegateProvider (server, client) + + &lit.jaxrs.container.DynamicFeature; (server) - + Similar to &lit.jaxrs.core.Feature; registration but only for server. + ComponentProvider (server) From a31178969567c9f5c4c5a15c13e87b0c205d7173 Mon Sep 17 00:00:00 2001 From: Maxim Nesen Date: Thu, 7 Oct 2021 14:41:06 +0200 Subject: [PATCH 2/2] Grammar corrections Signed-off-by: Maxim Nesen --- docs/src/main/docbook/deployment.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/src/main/docbook/deployment.xml b/docs/src/main/docbook/deployment.xml index 8fe8970850..55d8bb7fdd 100644 --- a/docs/src/main/docbook/deployment.xml +++ b/docs/src/main/docbook/deployment.xml @@ -199,12 +199,12 @@
Feature and Dynamic Feature SPI automatic registration - Since Jersey 3.1.0 there is new specification requirement to automatically discover and register classes which + Since Jersey 3.1.0 there is a new specification requirement to automatically discover and register classes that implement &jaxrs.core.Feature; and &jaxrs.container.DynamicFeature; interfaces. This is being done via SPI search thus all those classes in order to be discovered automatically shall be listed as SPIs for given interfaces. This automatic registration can also be disabled by jakarta.ws.rs.loadServices (which is new specification property) to be set to false. This is also valid for - &jersey.common.CommonProperties.FEATURE_AUTO_DISCOVERY_DISABLE; lookup . + &jersey.common.CommonProperties.FEATURE_AUTO_DISCOVERY_DISABLE; lookup.
@@ -222,7 +222,7 @@ List of SPIs recognized by Jersey &lit.jaxrs.core.Feature; (server, client) - - Features are being registered similarly as AutoDiscoverable feature. In addition + Features are being registered similarly to AutoDiscoverable feature. In addition property jakarta.ws.rs.loadServices is checked before registration.