jamesnetherton commented on code in PR #4428:
URL: https://github.com/apache/camel-quarkus/pull/4428#discussion_r1082178286


##########
extensions-support/language/deployment/src/main/java/org/apache/camel/quarkus/support/language/deployment/LanguageSupportProcessor.java:
##########
@@ -0,0 +1,87 @@
+/*
+ * 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.support.language.deployment;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import io.quarkus.bootstrap.classloading.QuarkusClassLoader;
+import io.quarkus.deployment.annotations.BuildProducer;
+import io.quarkus.deployment.annotations.BuildStep;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.quarkus.core.CamelConfig;
+import 
org.apache.camel.quarkus.core.deployment.spi.CamelRoutesBuilderClassBuildItem;
+import org.apache.camel.quarkus.support.language.deployment.dm.DryModeLanguage;
+import org.apache.camel.quarkus.support.language.deployment.dm.DryModeMain;
+import org.jboss.logging.Logger;
+
+class LanguageSupportProcessor {
+
+    private static final Logger LOG = 
Logger.getLogger(LanguageSupportProcessor.class);
+
+    @BuildStep
+    void extractExpressions(CamelConfig config, 
List<CamelRoutesBuilderClassBuildItem> routesBuilderClasses,
+            BuildProducer<ExpressionBuildItem> producer) throws Exception {
+        final ClassLoader loader = 
Thread.currentThread().getContextClassLoader();
+        if (!(loader instanceof QuarkusClassLoader)) {
+            throw new IllegalStateException(
+                    QuarkusClassLoader.class.getSimpleName() + " expected as 
the context class loader");
+        }
+        final List<Class<?>> routeBuilderClasses = new 
ArrayList<>(routesBuilderClasses.size());
+        for (CamelRoutesBuilderClassBuildItem routesBuilderClass : 
routesBuilderClasses) {
+            final String className = 
routesBuilderClass.getDotName().toString();
+            final Class<?> cl = loader.loadClass(className);
+
+            if (RouteBuilder.class.isAssignableFrom(cl)) {
+                routeBuilderClasses.add(cl);
+            } else {
+                LOG.warnf("CSimple language expressions occurring in %s won't 
be compiled at build time", cl);

Review Comment:
   Nitpick - Should we remove `CSimple` from the log message?



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