luigidemasi commented on code in PR #27082:
URL: https://github.com/apache/camel/pull/27082#discussion_r4133465493


##########
core/camel-core-model/src/main/java/org/apache/camel/model/app/SemanticDefinition.java:
##########
@@ -0,0 +1,73 @@
+/*
+ * 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.model.app;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import jakarta.xml.bind.annotation.XmlAccessType;
+import jakarta.xml.bind.annotation.XmlAccessorType;
+import jakarta.xml.bind.annotation.XmlElement;
+import jakarta.xml.bind.annotation.XmlType;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.Resource;
+
+/** Named, provider-independent semantic question declarations. */
+@Metadata(label = "configuration")
+@XmlType(name = "semanticDefinition")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class SemanticDefinition {
+    @XmlElement(name = "question")
+    @Metadata(description = "Named semantic questions shared by routes in this 
Camel context.")
+    private List<SemanticQuestionDefinition> questions = new ArrayList<>();
+
+    public List<SemanticQuestionDefinition> getQuestions() {
+        return questions;
+    }
+
+    public void setQuestions(List<SemanticQuestionDefinition> questions) {
+        this.questions = questions;
+    }
+
+    /** Declare a named semantic question. */
+    public SemanticQuestionDefinition question(String name) {
+        SemanticQuestionDefinition question = new SemanticQuestionDefinition();
+        question.setName(name);
+        questions.add(question);
+        return question;
+    }
+

Review Comment:
   Added a clarification in b6a0e7ed2db9: concurrent discovery can create 
equivalent instances of the stateless default configurer, while the semantic 
registry synchronizes creation and updates of shared question state. This does 
not rely on all route loading being single-threaded. No additional locking or 
plugin-registry API change is needed for the default implementation.
   
   _Codex on behalf of [luigidemasi](https://github.com/luigidemasi)._



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to