[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #249: Make xml and jaxb disabled by default and opt-in when depending on ca…

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #249: Make xml and jaxb disabled by default and opt-in when depending on ca…

GitBox
ppalaga 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_r333094900
 
 

 ##########
 File path: extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelModelJAXBContextFactoryBuildItem.java
 ##########
 @@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.core.deployment;
+
+import io.quarkus.builder.item.SimpleBuildItem;
+import io.quarkus.runtime.RuntimeValue;
+import org.apache.camel.spi.ModelJAXBContextFactory;
+
+/**
+ * Holds the {@link ModelJAXBContextFactory} {@link RuntimeValue}.
 
 Review comment:
   General question: The `value` field is not `RuntimeValue<ModelJAXBContextFactory>` (so the JavaDoc should eventually be adapted to match the reality) but the question is whether it should be the case. IIRC, the general rule in Quarkus is to instantiate the runtime classes only within a recorder and thus wrap them in a `RuntimeValue` in BuildItems. I recently discussed this with @lburgazzoli and we came to a conclusion that instantiation in a BuildProcessor may work for types that do not have any complex dependencies (that's probably the current case) but still I was not able to find an example of such a practice in Quarkus. So the question is what are the criteria for you to instantiate a runtime class in a BuildStep vs. in a Recorder?

----------------------------------------------------------------
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:
[hidden email]


With regards,
Apache Git Services