camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [camel-quarkus] ppalaga commented on a change in pull request #1018: Fix #1017 Do not hardcode the TransformerFactory implementation irrev…
Date Thu, 02 Apr 2020 15:50:41 GMT
ppalaga commented on a change in pull request #1018: Fix #1017 Do not hardcode the TransformerFactory
implementation irrev…
URL: https://github.com/apache/camel-quarkus/pull/1018#discussion_r402420510
 
 

 ##########
 File path: extensions-support/xalan/deployment/src/main/java/org/apache/camel/quarkus/support/xalan/deployment/CamelXalanBuildTimeConfig.java
 ##########
 @@ -14,24 +14,21 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.support.xalan.graal;
+package org.apache.camel.quarkus.support.xalan.deployment;
 
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.TransformerFactoryConfigurationError;
+import java.util.Optional;
 
-import com.oracle.svm.core.annotate.Substitute;
-import com.oracle.svm.core.annotate.TargetClass;
-import org.apache.xalan.xsltc.trax.TransformerFactoryImpl;
+import io.quarkus.runtime.annotations.ConfigItem;
+import io.quarkus.runtime.annotations.ConfigPhase;
+import io.quarkus.runtime.annotations.ConfigRoot;
 
-@TargetClass(className = "javax.xml.transform.TransformerFactory")
-final class TransformerFactorySubstitution {
-    @Substitute
-    public static TransformerFactory newDefaultInstance() {
-        return new TransformerFactoryImpl();
-    }
+@ConfigRoot(name = "camel.xalan", phase = ConfigPhase.BUILD_TIME)
+public class CamelXalanBuildTimeConfig {
 
-    @Substitute
-    public static TransformerFactory newInstance() throws TransformerFactoryConfigurationError
{
-        return newDefaultInstance();
-    }
+    /**
+     * A fully qualified class name to set as the {@code javax.xml.transform.TransformerFactory}
system property early
+     * at the application startup.
 
 Review comment:
   How about this new variant of the text?
   
   ```suggestion
        * A fully qualified class name to set as the {@code javax.xml.transform.TransformerFactory}
system property early
        * at the application startup. The system property effectively overrides any service
providers defined in
        * {@code META-INF/services/javax.xml.transform.TransformerFactory} files available
in the class path. If you do not
        * set the option the default value is used and the service providers are overriden
anyway.
        * <p>
        * Note that any custom transformer factory you pass will only work in native mode
if all necessary classes are
        * registered for reflection and all necessary resources are included in the native
image. This may already be the
        * case for {@code com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl}
if you depend on
        * {@code io.quarkus:quarkus-jaxb} or {@code org.apache.xalan.xsltc.trax.TransformerFactoryImpl}
if you depend on
        * {@code org.apache.camel.quarkus:camel-quarkus-support-xalan}.
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message