gnodet commented on a change in pull request #249: Make xml and jaxb disabled 
by default and opt-in when depending on ca…
URL: https://github.com/apache/camel-quarkus/pull/249#discussion_r334565054
 
 

 ##########
 File path: 
extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/BuildProcessor.java
 ##########
 @@ -105,15 +115,39 @@ CamelRegistryBuildItem registry(
             return new CamelRegistryBuildItem(registry);
         }
 
+        @Overridable
+        @BuildStep
+        public CamelModelJAXBContextFactoryBuildItem 
createJaxbContextFactory() {
+            return new CamelModelJAXBContextFactoryBuildItem(new 
DisabledModelJAXBContextFactory());
+        }
+
+        @Overridable
+        @BuildStep
+        public CamelXmlLoaderBuildItem createXmlLoader() {
+            return new CamelXmlLoaderBuildItem(new DisabledXmlLoader());
+        }
+
+        @BuildStep
+        void disableXmlReifiers(List<FeatureBuildItem> features) {
+            if 
(features.stream().map(FeatureBuildItem::getInfo).noneMatch("camel-xml"::equals))
 {
+                ProcessorReifier.registerReifier(ValidateDefinition.class, 
DisabledValidateReifier::new);
+                
ValidatorReifier.registerReifier(PredicateValidatorDefinition.class, 
DisabledPredicateValidatorReifier::new);
 
 Review comment:
   I'm not sure about that.  The code changes a static variable (the map of 
reifiers) which is later stored in the native image.  There's no need to call 
anything at a later point I think.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to