-
Sub-task
-
Resolution: Done
-
Blocker
-
None
-
None
-
None
Section 4.1.2 of the Jakarta RESTful Web Services specification requires the certain types to be discovered and registered unless the property jakarta.ws.rs.loadServices is set to false.
On runtime initialization, an implementation MUST discover and register certain service providers in jakarta.ws.rs.core.Configuration runtime configurations, if and only if service loading is enabled. Service loading is enabled, except when there is an Application subclass whose getProperties method returns a map which contains the key jakarta.ws.rs.loadServices with a value of Boolean.FALSE. For each service X, where X is jakarta.ws.rs.core.Feature or jakarta.ws.rs.container.DynamicFeature, the set of providers to be registered MUST be determined as follows:
- first, register all providers discovered with ServiceLoader.load(X.class)
- additionally, register all providers discovered with ServiceLoader.load(X.class, X.class.getClassLoader())
Note that service loading allows libraries to be self-sufficient: it allows them to register what they need with the JAX-RS implementation without intervention from the application. From the viewpoint of an application developer, this means that they do not need to understand the inner workings of their dependent libraries when overriding getClasses. As another example, it allows system integrators to extend the JAX-RS implementation (e.g. to provide integrations with other Jakarta EE specifications) in a completely portable manner.
- is blocked by
-
RESTEASY-3091 PriorityServiceLoader changes for REST 3.1 service loading
- Closed
- relates to
-
RESTEASY-3108 Deprecate the jakarta.ws.rs.ext.Providers service loading
- Open