You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2023/06/07 07:16:12 UTC

[camel-quarkus] branch 4959/delegate-to-quarkus-groovy created (now d4802f3ccc)

This is an automated email from the ASF dual-hosted git repository.

nfilotto pushed a change to branch 4959/delegate-to-quarkus-groovy
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git


      at d4802f3ccc Ref #4959: Delegate complexity to quarkus-groovy

This branch includes the following new commits:

     new d4802f3ccc Ref #4959: Delegate complexity to quarkus-groovy

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[camel-quarkus] 01/01: Ref #4959: Delegate complexity to quarkus-groovy

Posted by nf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

nfilotto pushed a commit to branch 4959/delegate-to-quarkus-groovy
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit d4802f3cccc957cc85bc7cc09263f6c7fb37b35c
Author: Nicolas Filotto <nf...@talend.com>
AuthorDate: Wed Jun 7 09:15:44 2023 +0200

    Ref #4959: Delegate complexity to quarkus-groovy
---
 extensions/groovy-dsl/deployment/pom.xml           |   4 +
 extensions/groovy-dsl/runtime/pom.xml              |   4 +
 .../groovy/runtime/graal/GroovySubstitutions.java  | 149 ---------------------
 .../graal/SubstituteGroovyRoutesBuilderLoader.java |  34 -----
 extensions/groovy/deployment/pom.xml               |   4 +-
 extensions/groovy/runtime/pom.xml                  |   4 +-
 pom.xml                                            |   1 +
 poms/bom/pom.xml                                   |  10 ++
 poms/bom/src/main/generated/flattened-full-pom.xml |  10 ++
 .../src/main/generated/flattened-reduced-pom.xml   |  10 ++
 .../generated/flattened-reduced-verbose-pom.xml    |  10 ++
 11 files changed, 53 insertions(+), 187 deletions(-)

diff --git a/extensions/groovy-dsl/deployment/pom.xml b/extensions/groovy-dsl/deployment/pom.xml
index 5f895bce22..1684486146 100644
--- a/extensions/groovy-dsl/deployment/pom.xml
+++ b/extensions/groovy-dsl/deployment/pom.xml
@@ -30,6 +30,10 @@
     <name>Camel Quarkus :: Groovy DSL :: Deployment</name>
 
     <dependencies>
+        <dependency>
+            <groupId>io.quarkiverse.groovy</groupId>
+            <artifactId>quarkus-groovy-deployment</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-core-deployment</artifactId>
diff --git a/extensions/groovy-dsl/runtime/pom.xml b/extensions/groovy-dsl/runtime/pom.xml
index e4f665b2bf..6fd35dc83c 100644
--- a/extensions/groovy-dsl/runtime/pom.xml
+++ b/extensions/groovy-dsl/runtime/pom.xml
@@ -36,6 +36,10 @@
     </properties>
 
     <dependencies>
+        <dependency>
+            <groupId>io.quarkiverse.groovy</groupId>
+            <artifactId>quarkus-groovy</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-core</artifactId>
diff --git a/extensions/groovy-dsl/runtime/src/main/java/org/apache/camel/quarkus/dsl/groovy/runtime/graal/GroovySubstitutions.java b/extensions/groovy-dsl/runtime/src/main/java/org/apache/camel/quarkus/dsl/groovy/runtime/graal/GroovySubstitutions.java
deleted file mode 100644
index 927018517c..0000000000
--- a/extensions/groovy-dsl/runtime/src/main/java/org/apache/camel/quarkus/dsl/groovy/runtime/graal/GroovySubstitutions.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * 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.dsl.groovy.runtime.graal;
-
-import java.lang.invoke.MethodHandle;
-import java.lang.invoke.MutableCallSite;
-import java.util.function.BiFunction;
-
-import com.oracle.svm.core.annotate.Alias;
-import com.oracle.svm.core.annotate.Substitute;
-import com.oracle.svm.core.annotate.TargetClass;
-import org.codehaus.groovy.control.SourceUnit;
-import org.codehaus.groovy.runtime.memoize.MemoizeCache;
-import org.codehaus.groovy.vmplugin.v8.CacheableCallSite;
-import org.codehaus.groovy.vmplugin.v8.IndyInterface;
-
-final class GroovySubstitutions {
-}
-
-@TargetClass(className = "org.codehaus.groovy.vmplugin.v8.MethodHandleWrapper")
-final class SubstituteMethodHandleWrapper {
-
-    @Alias
-    public boolean isCanSetTarget() {
-        return false;
-    }
-
-    @Alias
-    public MethodHandle getCachedMethodHandle() {
-        return null;
-    }
-}
-
-@TargetClass(className = "org.codehaus.groovy.vmplugin.v8.IndyInterface$FallbackSupplier")
-final class SubstituteIndyFallbackSupplier {
-
-    @Alias
-    SubstituteIndyFallbackSupplier(MutableCallSite callSite, Class<?> sender, String methodName, int callID,
-            Boolean safeNavigation, Boolean thisCall, Boolean spreadCall, Object dummyReceiver, Object[] arguments) {
-
-    }
-
-    @Alias
-    SubstituteMethodHandleWrapper get() {
-        return null;
-    }
-}
-
-@TargetClass(CacheableCallSite.class)
-final class SubstituteCacheableCallSite {
-
-    @Alias
-    public SubstituteMethodHandleWrapper getAndPut(String className,
-            MemoizeCache.ValueProvider<? super String, ? extends SubstituteMethodHandleWrapper> valueProvider) {
-        return null;
-    }
-}
-
-@TargetClass(IndyInterface.class)
-final class SubstituteIndyInterface {
-
-    @Alias
-    private static SubstituteMethodHandleWrapper NULL_METHOD_HANDLE_WRAPPER;
-
-    @Substitute
-    protected static void invalidateSwitchPoints() {
-        throw new UnsupportedOperationException("invalidateSwitchPoints is not supported");
-    }
-
-    @Alias
-    private static boolean bypassCache(Boolean spreadCall, Object[] arguments) {
-        return false;
-    }
-
-    @Alias
-    private static <T> T doWithCallSite(MutableCallSite callSite, Object[] arguments,
-            BiFunction<? super SubstituteCacheableCallSite, ? super Object, ? extends T> f) {
-        return null;
-    }
-
-    @Substitute
-    public static Object selectMethod(MutableCallSite callSite, Class<?> sender, String methodName, int callID,
-            Boolean safeNavigation, Boolean thisCall, Boolean spreadCall, Object dummyReceiver, Object[] arguments)
-            throws Throwable {
-        throw new UnsupportedOperationException("selectMethod is not supported");
-    }
-
-    @Substitute
-    public static Object fromCache(MutableCallSite callSite, Class<?> sender, String methodName, int callID,
-            Boolean safeNavigation, Boolean thisCall, Boolean spreadCall, Object dummyReceiver, Object[] arguments)
-            throws Throwable {
-        SubstituteIndyFallbackSupplier fallbackSupplier = new SubstituteIndyFallbackSupplier(callSite, sender, methodName,
-                callID, safeNavigation, thisCall, spreadCall, dummyReceiver, arguments);
-
-        SubstituteMethodHandleWrapper mhw = bypassCache(spreadCall, arguments)
-                ? NULL_METHOD_HANDLE_WRAPPER
-                : doWithCallSite(
-                        callSite, arguments,
-                        new FromCacheBiFunction(fallbackSupplier));
-
-        if (NULL_METHOD_HANDLE_WRAPPER == mhw) {
-            mhw = fallbackSupplier.get();
-        }
-
-        return mhw.getCachedMethodHandle().invokeExact(arguments);
-    }
-
-    static class FromCacheBiFunction implements BiFunction<SubstituteCacheableCallSite, Object, SubstituteMethodHandleWrapper> {
-
-        private final SubstituteIndyFallbackSupplier fallbackSupplier;
-
-        FromCacheBiFunction(SubstituteIndyFallbackSupplier fallbackSupplier) {
-            this.fallbackSupplier = fallbackSupplier;
-        }
-
-        @Override
-        public SubstituteMethodHandleWrapper apply(SubstituteCacheableCallSite cs, Object receiver) {
-            return cs.getAndPut(
-                    receiver.getClass().getName(),
-                    c -> {
-                        SubstituteMethodHandleWrapper fbMhw = fallbackSupplier.get();
-                        return fbMhw.isCanSetTarget() ? fbMhw : NULL_METHOD_HANDLE_WRAPPER;
-                    });
-        }
-    }
-}
-
-@TargetClass(SourceUnit.class)
-final class SubstituteSourceUnit {
-
-    @Substitute
-    public void convert() {
-        throw new UnsupportedOperationException("convert is not supported");
-    }
-}
diff --git a/extensions/groovy-dsl/runtime/src/main/java/org/apache/camel/quarkus/dsl/groovy/runtime/graal/SubstituteGroovyRoutesBuilderLoader.java b/extensions/groovy-dsl/runtime/src/main/java/org/apache/camel/quarkus/dsl/groovy/runtime/graal/SubstituteGroovyRoutesBuilderLoader.java
deleted file mode 100644
index d2880aaa95..0000000000
--- a/extensions/groovy-dsl/runtime/src/main/java/org/apache/camel/quarkus/dsl/groovy/runtime/graal/SubstituteGroovyRoutesBuilderLoader.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * 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.dsl.groovy.runtime.graal;
-
-import java.io.Reader;
-
-import com.oracle.svm.core.annotate.Substitute;
-import com.oracle.svm.core.annotate.TargetClass;
-import org.apache.camel.builder.endpoint.EndpointRouteBuilder;
-import org.apache.camel.dsl.groovy.GroovyRoutesBuilderLoader;
-
-@TargetClass(GroovyRoutesBuilderLoader.class)
-final class SubstituteGroovyRoutesBuilderLoader {
-
-    @Substitute
-    protected void doLoadEndpointRouteBuilder(Reader reader, EndpointRouteBuilder builder) {
-        // Do nothing
-    }
-
-}
diff --git a/extensions/groovy/deployment/pom.xml b/extensions/groovy/deployment/pom.xml
index 0beefa5e60..baf13b02b2 100644
--- a/extensions/groovy/deployment/pom.xml
+++ b/extensions/groovy/deployment/pom.xml
@@ -39,8 +39,8 @@
             <artifactId>camel-quarkus-groovy</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-groovy-dsl-deployment</artifactId>
+            <groupId>io.quarkiverse.groovy</groupId>
+            <artifactId>quarkus-groovy-deployment</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
diff --git a/extensions/groovy/runtime/pom.xml b/extensions/groovy/runtime/pom.xml
index b1f0e4483e..aa83d2b1c0 100644
--- a/extensions/groovy/runtime/pom.xml
+++ b/extensions/groovy/runtime/pom.xml
@@ -49,8 +49,8 @@
             <artifactId>camel-groovy</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-groovy-dsl</artifactId>
+            <groupId>io.quarkiverse.groovy</groupId>
+            <artifactId>quarkus-groovy</artifactId>
         </dependency>
     </dependencies>
 
diff --git a/pom.xml b/pom.xml
index 730209ac59..35bb4d1699 100644
--- a/pom.xml
+++ b/pom.xml
@@ -52,6 +52,7 @@
         <quarkiverse-artemis.version>3.0.0</quarkiverse-artemis.version><!-- https://repo1.maven.org/maven2/io/quarkiverse/artemis/quarkus-artemis-parent/ -->
         <quarkiverse-cxf.version>2.1.0</quarkiverse-cxf.version><!-- https://repo1.maven.org/maven2/io/quarkiverse/cxf/quarkus-cxf-parent/ -->
         <quarkiverse-freemarker.version>1.0.0</quarkiverse-freemarker.version><!-- https://repo1.maven.org/maven2/io/quarkiverse/freemarker/quarkus-freemarker-parent/ -->
+        <quarkiverse-groovy.version>3.1.0</quarkiverse-groovy.version><!-- https://repo1.maven.org/maven2/io/quarkiverse/groovy/quarkus-groovy-parent/ -->
         <quarkiverse-jackson-jq.version>2.0.1</quarkiverse-jackson-jq.version><!-- https://repo1.maven.org/maven2/io/quarkiverse/jackson-jq/quarkus-jackson-jq-parent/ -->
         <quarkiverse-jgit.version>3.0.0</quarkiverse-jgit.version><!-- https://repo1.maven.org/maven2/io/quarkiverse/jgit/quarkus-jgit-parent/ -->
         <quarkiverse-jsch.version>3.0.1</quarkiverse-jsch.version><!-- https://repo1.maven.org/maven2/io/quarkiverse/jsch/quarkus-jsch-parent/ -->
diff --git a/poms/bom/pom.xml b/poms/bom/pom.xml
index 63140acf54..5536f4ffb3 100644
--- a/poms/bom/pom.xml
+++ b/poms/bom/pom.xml
@@ -6193,6 +6193,16 @@
                 <artifactId>quarkus-freemarker-deployment</artifactId>
                 <version>${quarkiverse-freemarker.version}</version>
             </dependency>
+            <dependency>
+                <groupId>io.quarkiverse.groovy</groupId>
+                <artifactId>quarkus-groovy</artifactId>
+                <version>${quarkiverse-groovy.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>io.quarkiverse.groovy</groupId>
+                <artifactId>quarkus-groovy-deployment</artifactId>
+                <version>${quarkiverse-groovy.version}</version>
+            </dependency>
             <dependency>
                 <groupId>io.quarkiverse.jackson-jq</groupId>
                 <artifactId>quarkus-jackson-jq</artifactId>
diff --git a/poms/bom/src/main/generated/flattened-full-pom.xml b/poms/bom/src/main/generated/flattened-full-pom.xml
index 98bd4a5255..226ffcaf44 100644
--- a/poms/bom/src/main/generated/flattened-full-pom.xml
+++ b/poms/bom/src/main/generated/flattened-full-pom.xml
@@ -6116,6 +6116,16 @@
         <artifactId>quarkus-freemarker-deployment</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
         <version>1.0.0</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
       </dependency>
+      <dependency>
+        <groupId>io.quarkiverse.groovy</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+        <artifactId>quarkus-groovy</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+        <version>3.1.0</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+      </dependency>
+      <dependency>
+        <groupId>io.quarkiverse.groovy</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+        <artifactId>quarkus-groovy-deployment</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+        <version>3.1.0</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+      </dependency>
       <dependency>
         <groupId>io.quarkiverse.jackson-jq</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
         <artifactId>quarkus-jackson-jq</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
diff --git a/poms/bom/src/main/generated/flattened-reduced-pom.xml b/poms/bom/src/main/generated/flattened-reduced-pom.xml
index 20fdb8bcf7..6fe7e3793a 100644
--- a/poms/bom/src/main/generated/flattened-reduced-pom.xml
+++ b/poms/bom/src/main/generated/flattened-reduced-pom.xml
@@ -6116,6 +6116,16 @@
         <artifactId>quarkus-freemarker-deployment</artifactId>
         <version>1.0.0</version>
       </dependency>
+      <dependency>
+        <groupId>io.quarkiverse.groovy</groupId>
+        <artifactId>quarkus-groovy</artifactId>
+        <version>3.1.0</version>
+      </dependency>
+      <dependency>
+        <groupId>io.quarkiverse.groovy</groupId>
+        <artifactId>quarkus-groovy-deployment</artifactId>
+        <version>3.1.0</version>
+      </dependency>
       <dependency>
         <groupId>io.quarkiverse.jackson-jq</groupId>
         <artifactId>quarkus-jackson-jq</artifactId>
diff --git a/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml b/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml
index 45acd578ea..09bba7d5b7 100644
--- a/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml
+++ b/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml
@@ -6116,6 +6116,16 @@
         <artifactId>quarkus-freemarker-deployment</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
         <version>1.0.0</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
       </dependency>
+      <dependency>
+        <groupId>io.quarkiverse.groovy</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+        <artifactId>quarkus-groovy</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+        <version>3.1.0</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+      </dependency>
+      <dependency>
+        <groupId>io.quarkiverse.groovy</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+        <artifactId>quarkus-groovy-deployment</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+        <version>3.1.0</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+      </dependency>
       <dependency>
         <groupId>io.quarkiverse.jackson-jq</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
         <artifactId>quarkus-jackson-jq</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->