diff --git a/jaxb-api/src/main/java/jakarta/xml/bind/ContextFinder.java b/jaxb-api/src/main/java/jakarta/xml/bind/ContextFinder.java index 65667d8..6435cd1 100644 --- a/jaxb-api/src/main/java/jakarta/xml/bind/ContextFinder.java +++ b/jaxb-api/src/main/java/jakarta/xml/bind/ContextFinder.java @@ -10,10 +10,8 @@ package jakarta.xml.bind; -import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; -import java.io.InputStreamReader; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.URL; @@ -32,16 +30,13 @@ * This class is package private and therefore is not exposed as part of the * Jakarta XML Binding API. * - * This code is designed to implement the JAXB 1.0 spec pluggability feature + * This code is designed to implement the XML Binding spec pluggability feature * * @author
- * The following JAXB 1.0 requirement is only required for schema to - * java interface/implementation binding. It does not apply to Jakarta XML Binding annotated - * classes. Jakarta XML Binding Providers must generate a {@code jaxb.properties} file in - * each package containing schema derived classes. The property file must - * contain a property named {@code jakarta.xml.bind.context.factory} whose - * value is the name of the class that implements the {@code createContext} - * APIs. - * - *
- * The class supplied by the provider does not have to be assignable to - * {@code jakarta.xml.bind.JAXBContext}, it simply has to provide a class that - * implements the {@code createContext} APIs. - * - *
- * In addition, the provider must call the
+ * The provider must call the
* {@link DatatypeConverter#setDatatypeConverter(DatatypeConverterInterface)
* DatatypeConverter.setDatatypeConverter} api prior to any client
* invocations of the marshal and unmarshal methods. This is necessary to
@@ -191,29 +175,8 @@
*
- * If such a resource is discovered, it is {@link Properties#load(InputStream) loaded} as a property file, and
- * the value of the {@link #JAXB_CONTEXT_FACTORY} key will be assumed to be the provider factory class. If no value
- * found, {@code "jakarta.xml.bind.context.factory"} is used as a key for backwards compatibility reasons. This class is
- * then loaded by the associated class loader discussed above.
- *
- *
- * This phase of the look up allows some packages to force the use of a certain Jakarta XML Binding implementation.
- * (For example, perhaps the schema compiler has generated some vendor extension in the code.)
- *
- *
- * This configuration method is deprecated.
- *
- *
*
*
*
*
* Once the provider factory class is discovered, context creation is delegated to one of its * {@code createContext(...)} methods. * - * For backward compatibility reasons, there are two ways how to implement provider factory class: - *
- * - * public static JAXBContext createContext( - * String contextPath, - * ClassLoader classLoader, - * Map<String,Object> properties ) throws JAXBException - * - * public static JAXBContext createContext( - * Class[] classes, - * Map<String,Object> properties ) throws JAXBException - *- * In this scenario, appropriate static method is used instead of instance method. This approach is incompatible - * with {@link java.util.ServiceLoader} so it can't be used with step 3. - *
- * There is no difference in behavior of given method {@code createContext(...)} regardless of whether it uses approach - * 1 (JAXBContextFactory) or 2 (no interface, static methods). - * - * @apiNote - * Service discovery method using resource {@code /META-INF/services/jakarta.xml.bind.JAXBContext} (described in step 4) - * is supported only to allow backwards compatibility, it is strongly recommended to migrate to standard - * {@link java.util.ServiceLoader} mechanism (described in step 3). The difference here is the resource name, which - * doesn't match service's type name. - *
- * Also using providers implementing interface {@link JAXBContextFactory} is preferred over using ones defining - * static methods, same as {@link JAXBContext#JAXB_CONTEXT_FACTORY} property is preferred over property - * {@code "jakarta.xml.bind.context.factory"} - * * @implNote * Within the last step, if Glassfish AS environment detected, its specific service loader is used to find factory class. * @@ -381,16 +302,6 @@ public static JAXBContext newInstance( String contextPath ) * * *
- * To maintain compatibility with JAXB 1.0 schema to java
- * interface/implementation binding, enabled by schema customization
- * {@code
* If there are any global XML element name collisions across the various
* packages listed on the {@code contextPath}, a {@code JAXBException}
* will be thrown.
diff --git a/spec/src/main/asciidoc/appI-changelog.adoc b/spec/src/main/asciidoc/appI-changelog.adoc
index b6f941b..0245fe9 100644
--- a/spec/src/main/asciidoc/appI-changelog.adoc
+++ b/spec/src/main/asciidoc/appI-changelog.adoc
@@ -8,8 +8,12 @@
=== Changes in Version 4
* fixed cross-references in the specification document
-* removed deprecated jakarta.xml.bind.Validator
+* removed deprecated `jakarta.xml.bind.Validator`
* removed constraints on using `java.beans.Introspector`
+* removed deprecated steps in implementation lookup algorithm - dropped search
+through `jaxb.properties` file, `jakarta.xml.bind.context.factory` and
+`jakarta.xml.bind.JAXBContext` properties and `/META-INF/services/jakarta.xml.bind.JAXBContext`
+resource file
=== Changes in Version 3
diff --git a/spec/src/main/asciidoc/ch04-binding_framework.adoc b/spec/src/main/asciidoc/ch04-binding_framework.adoc
index 2b1d522..65e15b0 100644
--- a/spec/src/main/asciidoc/ch04-binding_framework.adoc
+++ b/spec/src/main/asciidoc/ch04-binding_framework.adoc
@@ -792,34 +792,15 @@ discovery happens each time `JAXBContext.newInstance` is invoked.
Implementation discovery consists of following steps in the order
specified (first successful resolution applies):
-. Context path or classes’ packages explicitly passed in
-to the newInstance method are searched for the jaxb.properties file. +
- +
-If such a resource is discovered, it is loaded as a property file,
-and the value of the `jakarta.xml.bind.JAXBContextFactory` key
-will be assumed to be the provider factory class.
-If no value found, `jakarta.xml.bind.context.factory` is used
-as a key for backwards compatibility reasons. +
- +
-This configuration method is deprecated.
-
. If the system property `jakarta.xml.bind.JAXBContextFactory` exists,
-then its value is assumed to be the provider factory class.
-If no such property exists, properties `jakarta.xml.bind.context.factory`
-and `jakarta.xml.bind.JAXBContext` are checked too (in this order),
-for backwards compatibility reasons.
+then its value is assumed to be the provider factory class. This phase
+of the look up enables per-JVM override of the Jakarta XML Binding implementation.
. Provider of `jakarta.xml.bind.JAXBContextFactory` is loaded
using the service-provider loading facilities, as defined by
Java SE Platform, to attempt to locate and load
an implementation of the service.
-. Look for resource `/META-INF/services/jakarta.xml.bind.JAXBContext`.
-If such a resource exists, its content is assumed to be the provider
-factory class. +
- +
- This configuration method is deprecated.
-
. Finally, if all of the steps above fail,
then the rest of the look up is unspecified.