diff --git a/.github/workflows/build-and-test-pr.yml b/.github/workflows/build-and-test-pr.yml index 3dd5536095..1d0174dfd5 100644 --- a/.github/workflows/build-and-test-pr.yml +++ b/.github/workflows/build-and-test-pr.yml @@ -431,8 +431,8 @@ jobs: - name: "Compile and run Dubbo demo for native (Linux)" run: | cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider - ${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true - nohup ./target/demo-native-provider & + ${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true native:compile + nohup ./target/dubbo-demo-native-provider & cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer - ${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true - ./target/demo-native-consumer + ${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true native:compile + ./target/dubbo-demo-native-consumer diff --git a/.github/workflows/build-and-test-scheduled-3.1.yml b/.github/workflows/build-and-test-scheduled-3.1.yml index eebfdcc395..7b1d67449f 100644 --- a/.github/workflows/build-and-test-scheduled-3.1.yml +++ b/.github/workflows/build-and-test-scheduled-3.1.yml @@ -395,8 +395,8 @@ jobs: - name: "Compile and run Dubbo demo for native (Linux)" run: | cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider - ${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true - nohup ./target/demo-native-provider & + ${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true native:compile + nohup ./target/dubbo-demo-native-provider & cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer - ${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true - ./target/demo-native-consumer + ${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true native:compile + ./target/dubbo-demo-native-consumer diff --git a/.github/workflows/build-and-test-scheduled-3.2.yml b/.github/workflows/build-and-test-scheduled-3.2.yml index 5c8c43dd34..26593e2dc1 100644 --- a/.github/workflows/build-and-test-scheduled-3.2.yml +++ b/.github/workflows/build-and-test-scheduled-3.2.yml @@ -395,8 +395,8 @@ jobs: - name: "Compile and run Dubbo demo for native (Linux)" run: | cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider - ${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true - nohup ./target/demo-native-provider & + ${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true native:compile + nohup ./target/dubbo-demo-native-provider & cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer - ${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true - ./target/demo-native-consumer + ${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true native:compile + ./target/dubbo-demo-native-consumer diff --git a/.github/workflows/release-test.yml b/.github/workflows/release-test.yml index 17c591e6c8..08fbec1abc 100644 --- a/.github/workflows/release-test.yml +++ b/.github/workflows/release-test.yml @@ -374,8 +374,8 @@ jobs: - name: "Compile and run Dubbo demo for native (Linux)" run: | cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider - ${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true - nohup ./target/demo-native-provider & + ${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true native:compile + nohup ./target/dubbo-demo-native-provider & cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer - ${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true - ./target/demo-native-consumer + ${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true native:compile + ./target/dubbo-demo-native-consumer diff --git a/.gitignore b/.gitignore index 4489022701..1f1a579238 100644 --- a/.gitignore +++ b/.gitignore @@ -48,8 +48,3 @@ dubbo-demo/dubbo-demo-triple/build/* # global registry center .tmp -dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer/src/main/resources/META-INF/native-image -dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer/src/main/generated -dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider/src/main/resources/META-INF/native-image -dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider/src/main/generated - diff --git a/.licenserc.yaml b/.licenserc.yaml index 3e6ecd2baf..f28b16a727 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -79,6 +79,21 @@ header: - 'dubbo-test/dubbo-test-common/src/main/java/org/apache/dubbo/test/common/utils/TestSocketUtils.java' - 'dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/TriHttp2RemoteFlowController.java' - 'dubbo-common/src/main/java/org/apache/dubbo/common/threadpool/serial/SerializingExecutor.java' + - 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/AbstractAotMojo.java' + - 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/AbstractDependencyFilterMojo.java' + - 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/CommandLineBuilder.java' + - 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/DependencyFilter.java' + - 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/Exclude.java' + - 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/ExcludeFilter.java' + - 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/FilterableDependency.java' + - 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/Include.java' + - 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/IncludeFilter.java' + - 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/JavaCompilerPluginConfiguration.java' + - 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/JavaExecutable.java' + - 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/JavaProcessExecutor.java' + - 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/MatchingGroupIdFilter.java' + - 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/RunArguments.java' + - 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/RunProcess.java' comment: on-failure diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/utils/Assert.java b/dubbo-common/src/main/java/org/apache/dubbo/common/utils/Assert.java index 42c7166c2c..9c5ec040ac 100644 --- a/dubbo-common/src/main/java/org/apache/dubbo/common/utils/Assert.java +++ b/dubbo-common/src/main/java/org/apache/dubbo/common/utils/Assert.java @@ -17,6 +17,8 @@ package org.apache.dubbo.common.utils; +import java.util.function.Supplier; + public abstract class Assert { protected Assert() { @@ -46,4 +48,14 @@ public abstract class Assert { } } + public static void assertTrue(boolean expression, Supplier messageSupplier) { + if (!expression) { + throw new IllegalStateException(nullSafeGet(messageSupplier)); + } + } + + private static String nullSafeGet(Supplier messageSupplier) { + return (messageSupplier != null ? messageSupplier.get() : null); + } + } diff --git a/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer/pom.xml b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer/pom.xml index ca585c6368..279701893a 100644 --- a/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer/pom.xml +++ b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer/pom.xml @@ -59,10 +59,6 @@ org.apache.dubbo dubbo-remoting-netty4 - - org.apache.dubbo - dubbo-serialization-hessian2 - org.apache.dubbo dubbo-serialization-fastjson2 @@ -94,17 +90,6 @@ - - - dev - - true - - - dev - - - native @@ -114,13 +99,16 @@ org.apache.dubbo - dubbo-native-plugin + dubbo-maven-plugin ${project.version} + + com.apache.dubbo.demo.graalvm.consumer.Application + process-sources - generate + dubbo-process-aot @@ -144,69 +132,19 @@ - org.graalvm.nativeimage - native-image-maven-plugin - 21.2.0 - - - - native-image - - package - - + org.graalvm.buildtools + native-maven-plugin + 0.9.19 - false - demo-native-consumer + ${project.build.outputDirectory} + + true + + 22.3 com.apache.dubbo.demo.graalvm.consumer.Application - - --no-fallback - - --initialize-at-build-time=org.slf4j.MDC - --initialize-at-build-time=org.apache.log4j.MDC - --initialize-at-build-time=org.slf4j.LoggerFactory - --initialize-at-build-time=org.slf4j.impl.StaticLoggerBinder - --initialize-at-build-time=org.apache.log4j.helpers.Loader - --initialize-at-build-time=org.apache.log4j.Logger - --initialize-at-build-time=org.apache.log4j.helpers.LogLog - --initialize-at-build-time=org.apache.log4j.LogManager - --initialize-at-build-time=org.apache.log4j.spi.LoggingEvent - --initialize-at-build-time=org.slf4j.impl.Log4jLoggerFactory - --initialize-at-build-time=org.slf4j.impl.Log4jLoggerAdapter - --initialize-at-build-time=org.eclipse.collections.api.factory.Sets - --initialize-at-build-time=io.netty.util.internal.logging.Log4JLogger - - - --initialize-at-run-time=io.netty.channel.epoll.Epoll - --initialize-at-run-time=io.netty.channel.epoll.Native - --initialize-at-run-time=io.netty.channel.epoll.EpollEventLoop - --initialize-at-run-time=io.netty.channel.epoll.EpollEventArray - --initialize-at-run-time=io.netty.channel.DefaultFileRegion - --initialize-at-run-time=io.netty.channel.kqueue.KQueueEventArray - --initialize-at-run-time=io.netty.channel.kqueue.KQueueEventLoop - --initialize-at-run-time=io.netty.channel.kqueue.Native - --initialize-at-run-time=io.netty.channel.unix.Errors - --initialize-at-run-time=io.netty.channel.unix.IovArray - --initialize-at-run-time=io.netty.channel.unix.Limits - --initialize-at-run-time=io.netty.channel.unix.Socket - --initialize-at-run-time=io.netty.channel.ChannelHandlerMask - --initialize-at-run-time=io.netty.internal.tcnative.CertificateVerifier - --initialize-at-run-time=io.netty.internal.tcnative.AsyncSSLPrivateKeyMethod - --initialize-at-run-time=io.netty.handler.ssl.ReferenceCountedOpenSslEngine - --initialize-at-run-time=io.netty.handler.ssl.OpenSslPrivateKeyMethod - --initialize-at-run-time=io.netty.internal.tcnative.CertificateVerifier - --initialize-at-run-time=io.netty.internal.tcnative.SSL - --initialize-at-run-time=io.netty.handler.ssl.OpenSslAsyncPrivateKeyMethod - --initialize-at-run-time=io.netty.internal.tcnative.SSLPrivateKeyMethod - - --report-unsupported-elements-at-runtime - --allow-incomplete-classpath - --enable-url-protocols=http - -H:+ReportExceptionStackTraces - -H:+AllowJRTFileSystem - + diff --git a/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer/src/main/resources/META-INF/native-image/proxy-config.json b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer/src/main/resources/META-INF/native-image/proxy-config.json new file mode 100644 index 0000000000..49f2fc2d51 --- /dev/null +++ b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer/src/main/resources/META-INF/native-image/proxy-config.json @@ -0,0 +1,7 @@ +[ + [ + "org.apace.dubbo.graalvm.demo.DemoService", + "org.apache.dubbo.rpc.service.EchoService", + "org.apache.dubbo.rpc.service.Destroyable" + ] +] diff --git a/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider/pom.xml b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider/pom.xml index 4dff085cc6..b35faa8482 100644 --- a/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider/pom.xml +++ b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider/pom.xml @@ -58,10 +58,6 @@ org.apache.dubbo dubbo-remoting-netty4 - - org.apache.dubbo - dubbo-serialization-hessian2 - org.apache.dubbo dubbo-serialization-fastjson2 @@ -94,17 +90,6 @@ - - - dev - - true - - - dev - - - native @@ -115,13 +100,16 @@ org.apache.dubbo - dubbo-native-plugin + dubbo-maven-plugin ${project.version} + + org.apache.dubbo.demo.graalvm.provider.Application + process-sources - generate + dubbo-process-aot @@ -129,7 +117,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.10.1 + 3.7.0 1.8 1.8 @@ -143,71 +131,20 @@ - - org.graalvm.nativeimage - native-image-maven-plugin - 21.2.0 - - - - native-image - - package - - + org.graalvm.buildtools + native-maven-plugin + 0.9.19 - false - demo-native-provider + ${project.build.outputDirectory} + + true + + 22.3 org.apache.dubbo.demo.graalvm.provider.Application - - --no-fallback - - --initialize-at-build-time=org.slf4j.MDC - --initialize-at-build-time=org.apache.log4j.MDC - --initialize-at-build-time=org.slf4j.LoggerFactory - --initialize-at-build-time=org.slf4j.impl.StaticLoggerBinder - --initialize-at-build-time=org.apache.log4j.helpers.Loader - --initialize-at-build-time=org.apache.log4j.Logger - --initialize-at-build-time=org.apache.log4j.helpers.LogLog - --initialize-at-build-time=org.apache.log4j.LogManager - --initialize-at-build-time=org.apache.log4j.spi.LoggingEvent - --initialize-at-build-time=org.slf4j.impl.Log4jLoggerFactory - --initialize-at-build-time=org.slf4j.impl.Log4jLoggerAdapter - --initialize-at-build-time=org.eclipse.collections.api.factory.Sets - --initialize-at-build-time=io.netty.util.internal.logging.Log4JLogger - - - --initialize-at-run-time=io.netty.channel.epoll.Epoll - --initialize-at-run-time=io.netty.channel.epoll.Native - --initialize-at-run-time=io.netty.channel.epoll.EpollEventLoop - --initialize-at-run-time=io.netty.channel.epoll.EpollEventArray - --initialize-at-run-time=io.netty.channel.DefaultFileRegion - --initialize-at-run-time=io.netty.channel.kqueue.KQueueEventArray - --initialize-at-run-time=io.netty.channel.kqueue.KQueueEventLoop - --initialize-at-run-time=io.netty.channel.kqueue.Native - --initialize-at-run-time=io.netty.channel.unix.Errors - --initialize-at-run-time=io.netty.channel.unix.IovArray - --initialize-at-run-time=io.netty.channel.unix.Limits - --initialize-at-run-time=io.netty.channel.unix.Socket - --initialize-at-run-time=io.netty.channel.ChannelHandlerMask - --initialize-at-run-time=io.netty.internal.tcnative.CertificateVerifier - --initialize-at-run-time=io.netty.internal.tcnative.AsyncSSLPrivateKeyMethod - --initialize-at-run-time=io.netty.handler.ssl.ReferenceCountedOpenSslEngine - --initialize-at-run-time=io.netty.handler.ssl.OpenSslPrivateKeyMethod - --initialize-at-run-time=io.netty.internal.tcnative.CertificateVerifier - --initialize-at-run-time=io.netty.internal.tcnative.SSL - --initialize-at-run-time=io.netty.handler.ssl.OpenSslAsyncPrivateKeyMethod - --initialize-at-run-time=io.netty.internal.tcnative.SSLPrivateKeyMethod - - --report-unsupported-elements-at-runtime - --allow-incomplete-classpath - --enable-url-protocols=http - -H:+ReportExceptionStackTraces - -H:+AllowJRTFileSystem - + diff --git a/dubbo-distribution/dubbo-bom/pom.xml b/dubbo-distribution/dubbo-bom/pom.xml index 4b5b5fcd51..988e6cc411 100644 --- a/dubbo-distribution/dubbo-bom/pom.xml +++ b/dubbo-distribution/dubbo-bom/pom.xml @@ -282,6 +282,12 @@ ${project.version} + + org.apache.dubbo + dubbo-maven-plugin + ${project.version} + + org.apache.dubbo diff --git a/dubbo-maven-plugin/pom.xml b/dubbo-maven-plugin/pom.xml new file mode 100644 index 0000000000..e15d57d96f --- /dev/null +++ b/dubbo-maven-plugin/pom.xml @@ -0,0 +1,109 @@ + + + 4.0.0 + + dubbo-parent + org.apache.dubbo + ${revision} + + + dubbo-maven-plugin + + + + Dubbo Maven Plugin + maven-plugin + + + + org.apache.maven + maven-plugin-api + 3.5.4 + + + + org.apache.maven + maven-core + 3.8.7 + provided + + + + + org.apache.maven.plugin-tools + maven-plugin-annotations + 3.7.1 + provided + + + + org.apache.maven.shared + maven-common-artifact-filters + 3.2.0 + + + + org.apache.dubbo + dubbo-common + ${project.version} + + + + + commons-io + commons-io + 2.11.0 + + + + + + + maven-plugin-plugin + 3.7.1 + + + default-addPluginArtifactMetadata + package + + addPluginArtifactMetadata + + + + default-descriptor + process-classes + + descriptor + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 8 + 8 + + + + + + + diff --git a/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/AbstractAotMojo.java b/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/AbstractAotMojo.java new file mode 100644 index 0000000000..efccafd249 --- /dev/null +++ b/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/AbstractAotMojo.java @@ -0,0 +1,219 @@ +/* + * Copyright 2012-2022 the original author or authors. + * + * Licensed 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 + * + * https://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.dubbo.maven.plugin.aot; + + +import org.apache.maven.execution.MavenSession; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugins.annotations.Component; +import org.apache.maven.plugins.annotations.Parameter; +import org.apache.maven.shared.artifact.filter.collection.ArtifactsFilter; +import org.apache.maven.toolchain.ToolchainManager; + +import javax.tools.Diagnostic; +import javax.tools.DiagnosticListener; +import javax.tools.JavaCompiler; +import javax.tools.JavaFileObject; +import javax.tools.StandardJavaFileManager; +import javax.tools.ToolProvider; +import java.io.File; +import java.io.IOException; +import java.net.URL; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * Abstract base class for AOT processing MOJOs. + * + * @author Phillip Webb + * @author Scott Frederick + */ +public abstract class AbstractAotMojo extends AbstractDependencyFilterMojo { + + /** + * The current Maven session. This is used for toolchain manager API calls. + */ + @Parameter(defaultValue = "${session}", readonly = true) + private MavenSession session; + + /** + * The toolchain manager to use to locate a custom JDK. + */ + @Component + private ToolchainManager toolchainManager; + + /** + * Skip the execution. + */ + @Parameter(property = "dubbo.aot.skip", defaultValue = "false") + private boolean skip; + + /** + * List of JVM system properties to pass to the AOT process. + */ + @Parameter + private Map systemPropertyVariables; + + /** + * JVM arguments that should be associated with the AOT process. On command line, make + * sure to wrap multiple values between quotes. + */ + @Parameter(property = "dubbo.aot.jvmArguments") + private String jvmArguments; + + + /** + * Arguments that should be provided to the AOT compile process. On command line, make + * sure to wrap multiple values between quotes. + */ + @Parameter(property = "dubbo.aot.compilerArguments") + private String compilerArguments; + + @Override + public void execute() throws MojoExecutionException, MojoFailureException { + if (this.skip) { + getLog().debug("Skipping AOT execution as per configuration"); + return; + } + try { + executeAot(); + } catch (Exception ex) { + throw new MojoExecutionException(ex.getMessage(), ex); + } + } + + protected abstract void executeAot() throws Exception; + + protected void generateAotAssets(URL[] classPath, String processorClassName, String... arguments) throws Exception { + List command = CommandLineBuilder.forMainClass(processorClassName) + .withSystemProperties(this.systemPropertyVariables) + .withJvmArguments(new RunArguments(this.jvmArguments).asArray()).withClasspath(classPath) + .withArguments(arguments).build(); + if (getLog().isDebugEnabled()) { + getLog().debug("Generating AOT assets using command: " + command); + } + JavaProcessExecutor processExecutor = new JavaProcessExecutor(this.session, this.toolchainManager); + getLog().info("dir: " + this.project.getBasedir()); + processExecutor.run(this.project.getBasedir(), command, Collections.emptyMap()); + } + + protected final void compileSourceFiles(URL[] classPath, File sourcesDirectory, File outputDirectory) + throws Exception { + List sourceFiles; + try (Stream pathStream = Files.walk(sourcesDirectory.toPath())) { + sourceFiles = pathStream.filter(Files::isRegularFile).map(Path::toFile).collect(Collectors.toList()); + } + if (sourceFiles.isEmpty()) { + return; + } + JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); + try (StandardJavaFileManager fileManager = compiler.getStandardFileManager(null, null, null)) { + JavaCompilerPluginConfiguration compilerConfiguration = new JavaCompilerPluginConfiguration(this.project); + List options = new ArrayList<>(); + options.add("-cp"); + options.add(CommandLineBuilder.ClasspathBuilder.build(Arrays.asList(classPath))); + options.add("-d"); + options.add(outputDirectory.toPath().toAbsolutePath().toString()); + String releaseVersion = compilerConfiguration.getReleaseVersion(); + if (releaseVersion != null) { + options.add("--release"); + options.add(releaseVersion); + } + else { + options.add("--source"); + options.add(compilerConfiguration.getSourceMajorVersion()); + options.add("--target"); + options.add(compilerConfiguration.getTargetMajorVersion()); + } + options.addAll(new RunArguments(this.compilerArguments).getArgs()); + Iterable compilationUnits = fileManager.getJavaFileObjectsFromFiles(sourceFiles); + Errors errors = new Errors(); + JavaCompiler.CompilationTask task = compiler.getTask(null, fileManager, errors, options, null, compilationUnits); + boolean result = task.call(); + if (!result || errors.hasReportedErrors()) { + throw new IllegalStateException("Unable to compile generated source" + errors); + } + } + } + + protected final List getClassPath(File[] directories, ArtifactsFilter... artifactFilters) + throws MojoExecutionException { + List urls = new ArrayList<>(); + Arrays.stream(directories).map(this::toURL).forEach(urls::add); + urls.addAll(getDependencyURLs(artifactFilters)); + return urls; + } + + protected final void copyAll(Path from, Path to) throws IOException { + if (!Files.exists(from)) { + return; + } + List files; + try (Stream pathStream = Files.walk(from)) { + files = pathStream.filter(Files::isRegularFile).collect(Collectors.toList()); + } + for (Path file : files) { + String relativeFileName = file.subpath(from.getNameCount(), file.getNameCount()).toString(); + getLog().debug("Copying '" + relativeFileName + "' to " + to); + Path target = to.resolve(relativeFileName); + Files.createDirectories(target.getParent()); + Files.copy(file, target, StandardCopyOption.REPLACE_EXISTING); + } + } + + /** + * {@link DiagnosticListener} used to collect errors. + */ + protected static class Errors implements DiagnosticListener { + + private final StringBuilder message = new StringBuilder(); + + @Override + public void report(Diagnostic diagnostic) { + if (diagnostic.getKind() == Diagnostic.Kind.ERROR) { + this.message.append("\n"); + this.message.append(diagnostic.getMessage(Locale.getDefault())); + if (diagnostic.getSource() != null) { + this.message.append(" "); + this.message.append(diagnostic.getSource().getName()); + this.message.append(" "); + this.message.append(diagnostic.getLineNumber()).append(":").append(diagnostic.getColumnNumber()); + } + } + } + + boolean hasReportedErrors() { + return this.message.length() > 0; + } + + @Override + public String toString() { + return this.message.toString(); + } + + } + +} diff --git a/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/AbstractDependencyFilterMojo.java b/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/AbstractDependencyFilterMojo.java new file mode 100644 index 0000000000..84ba4ac26c --- /dev/null +++ b/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/AbstractDependencyFilterMojo.java @@ -0,0 +1,172 @@ +/* + * Copyright 2012-2022 the original author or authors. + * + * Licensed 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 + * + * https://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.dubbo.maven.plugin.aot; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.resolver.filter.ArtifactFilter; +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugins.annotations.Parameter; +import org.apache.maven.project.MavenProject; +import org.apache.maven.shared.artifact.filter.collection.AbstractArtifactFeatureFilter; +import org.apache.maven.shared.artifact.filter.collection.ArtifactFilterException; +import org.apache.maven.shared.artifact.filter.collection.ArtifactsFilter; +import org.apache.maven.shared.artifact.filter.collection.FilterArtifacts; + +import java.io.File; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +import java.util.StringTokenizer; + +/** + * A base mojo filtering the dependencies of the project. + * + * @author Stephane Nicoll + * @author David Turanski + */ +public abstract class AbstractDependencyFilterMojo extends AbstractMojo { + + /** + * The Maven project. + */ + @Parameter(defaultValue = "${project}", readonly = true, required = true) + protected MavenProject project; + + /** + * Collection of artifact definitions to include. The {@link Include} element defines + * mandatory {@code groupId} and {@code artifactId} properties and an optional + * mandatory {@code groupId} and {@code artifactId} properties and an optional + * {@code classifier} property. + */ + @Parameter(property = "dubbo.includes") + private List includes; + + /** + * Collection of artifact definitions to exclude. The {@link Exclude} element defines + * mandatory {@code groupId} and {@code artifactId} properties and an optional + * {@code classifier} property. + */ + @Parameter(property = "dubbo.excludes") + private List excludes; + + /** + * Comma separated list of groupId names to exclude (exact match). + */ + @Parameter(property = "dubbo.excludeGroupIds", defaultValue = "") + private String excludeGroupIds; + + protected void setExcludes(List excludes) { + this.excludes = excludes; + } + + protected void setIncludes(List includes) { + this.includes = includes; + } + + protected void setExcludeGroupIds(String excludeGroupIds) { + this.excludeGroupIds = excludeGroupIds; + } + + protected List getDependencyURLs(ArtifactsFilter... additionalFilters) throws MojoExecutionException { + Set artifacts = filterDependencies(this.project.getArtifacts(), additionalFilters); + List urls = new ArrayList<>(); + for (Artifact artifact : artifacts) { + if (artifact.getFile() != null) { + urls.add(toURL(artifact.getFile())); + } + } + return urls; + } + + protected final Set filterDependencies(Set dependencies, ArtifactsFilter... additionalFilters) + throws MojoExecutionException { + try { + Set filtered = new LinkedHashSet<>(dependencies); + filtered.retainAll(getFilters(additionalFilters).filter(dependencies)); + return filtered; + } + catch (ArtifactFilterException ex) { + throw new MojoExecutionException(ex.getMessage(), ex); + } + } + + protected URL toURL(File file) { + try { + return file.toURI().toURL(); + } + catch (MalformedURLException ex) { + throw new IllegalStateException("Invalid URL for " + file, ex); + } + } + + /** + * Return artifact filters configured for this MOJO. + * @param additionalFilters optional additional filters to apply + * @return the filters + */ + private FilterArtifacts getFilters(ArtifactsFilter... additionalFilters) { + FilterArtifacts filters = new FilterArtifacts(); + for (ArtifactsFilter additionalFilter : additionalFilters) { + filters.addFilter(additionalFilter); + } + filters.addFilter(new MatchingGroupIdFilter(cleanFilterConfig(this.excludeGroupIds))); + if (this.includes != null && !this.includes.isEmpty()) { + filters.addFilter(new IncludeFilter(this.includes)); + } + if (this.excludes != null && !this.excludes.isEmpty()) { + filters.addFilter(new ExcludeFilter(this.excludes)); + } + return filters; + } + + private String cleanFilterConfig(String content) { + if (content == null || content.trim().isEmpty()) { + return ""; + } + StringBuilder cleaned = new StringBuilder(); + StringTokenizer tokenizer = new StringTokenizer(content, ","); + while (tokenizer.hasMoreElements()) { + cleaned.append(tokenizer.nextToken().trim()); + if (tokenizer.hasMoreElements()) { + cleaned.append(","); + } + } + return cleaned.toString(); + } + + /** + * {@link ArtifactFilter} to exclude test scope dependencies. + */ + protected static class ExcludeTestScopeArtifactFilter extends AbstractArtifactFeatureFilter { + + ExcludeTestScopeArtifactFilter() { + super("", Artifact.SCOPE_TEST); + } + + @Override + protected String getArtifactFeature(Artifact artifact) { + return artifact.getScope(); + } + + } + +} + diff --git a/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/CommandLineBuilder.java b/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/CommandLineBuilder.java new file mode 100644 index 0000000000..8c759d2d4e --- /dev/null +++ b/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/CommandLineBuilder.java @@ -0,0 +1,136 @@ +/* + * Copyright 2012-2022 the original author or authors. + * + * Licensed 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 + * + * https://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.dubbo.maven.plugin.aot; + +import java.io.File; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * Helper class to build the command-line arguments of a java process. + * + * @author Stephane Nicoll + */ +final class CommandLineBuilder { + + private final List options = new ArrayList<>(); + + private final List classpathElements = new ArrayList<>(); + + private final String mainClass; + + private final List arguments = new ArrayList<>(); + + private CommandLineBuilder(String mainClass) { + this.mainClass = mainClass; + } + + static CommandLineBuilder forMainClass(String mainClass) { + return new CommandLineBuilder(mainClass); + } + + CommandLineBuilder withJvmArguments(String... jvmArguments) { + if (jvmArguments != null) { + this.options.addAll(Arrays.stream(jvmArguments).filter(Objects::nonNull).collect(Collectors.toList())); + } + return this; + } + + CommandLineBuilder withSystemProperties(Map systemProperties) { + if (systemProperties != null) { + systemProperties.entrySet().stream().map((e) -> SystemPropertyFormatter.format(e.getKey(), e.getValue())) + .forEach(this.options::add); + } + return this; + } + + CommandLineBuilder withClasspath(URL... elements) { + this.classpathElements.addAll(Arrays.asList(elements)); + return this; + } + + CommandLineBuilder withArguments(String... arguments) { + if (arguments != null) { + this.arguments.addAll(Arrays.stream(arguments).filter(Objects::nonNull).collect(Collectors.toList())); + } + return this; + } + + List build() { + List commandLine = new ArrayList<>(); + if (!this.options.isEmpty()) { + commandLine.addAll(this.options); + } + if (!this.classpathElements.isEmpty()) { + commandLine.add("-cp"); + commandLine.add(ClasspathBuilder.build(this.classpathElements)); + } + commandLine.add(this.mainClass); + if (!this.arguments.isEmpty()) { + commandLine.addAll(this.arguments); + } + return commandLine; + } + + static class ClasspathBuilder { + + static String build(List classpathElements) { + StringBuilder classpath = new StringBuilder(); + for (URL element : classpathElements) { + if (classpath.length() > 0) { + classpath.append(File.pathSeparator); + } + classpath.append(toFile(element)); + } + return classpath.toString(); + } + + private static File toFile(URL element) { + try { + return new File(element.toURI()); + } + catch (URISyntaxException ex) { + throw new IllegalArgumentException(ex); + } + } + + } + + /** + * Format System properties. + */ + private static class SystemPropertyFormatter { + + static String format(String key, String value) { + if (key == null) { + return ""; + } + if (value == null || value.isEmpty()) { + return String.format("-D%s", key); + } + return String.format("-D%s=\"%s\"", key, value); + } + + } + +} diff --git a/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/DependencyFilter.java b/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/DependencyFilter.java new file mode 100644 index 0000000000..54ea0a7147 --- /dev/null +++ b/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/DependencyFilter.java @@ -0,0 +1,83 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed 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 + * + * https://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.dubbo.maven.plugin.aot; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.shared.artifact.filter.collection.AbstractArtifactsFilter; +import org.apache.maven.shared.artifact.filter.collection.ArtifactFilterException; +import org.apache.maven.shared.artifact.filter.collection.ArtifactsFilter; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * Base class for {@link ArtifactsFilter} based on a {@link org.apache.dubbo.maven.plugin.aot.FilterableDependency} list. + * + * @author Stephane Nicoll + * @author David Turanski + */ +public abstract class DependencyFilter extends AbstractArtifactsFilter { + + private final List filters; + + /** + * Create a new instance with the list of {@link FilterableDependency} instance(s) to + * use. + * @param dependencies the source dependencies + */ + public DependencyFilter(List dependencies) { + this.filters = dependencies; + } + + @Override + public Set filter(Set artifacts) throws ArtifactFilterException { + Set result = new HashSet<>(); + for (Artifact artifact : artifacts) { + if (!filter(artifact)) { + result.add(artifact); + } + } + return result; + } + + protected abstract boolean filter(Artifact artifact); + + /** + * Check if the specified {@link Artifact} matches the + * specified {@link org.apache.dubbo.maven.plugin.aot.FilterableDependency}. Returns + * {@code true} if it should be excluded + * @param artifact the Maven {@link Artifact} + * @param dependency the {@link org.apache.dubbo.maven.plugin.aot.FilterableDependency} + * @return {@code true} if the artifact matches the dependency + */ + protected final boolean equals(Artifact artifact, FilterableDependency dependency) { + if (!dependency.getGroupId().equals(artifact.getGroupId())) { + return false; + } + if (!dependency.getArtifactId().equals(artifact.getArtifactId())) { + return false; + } + return (dependency.getClassifier() == null + || artifact.getClassifier() != null && dependency.getClassifier().equals(artifact.getClassifier())); + } + + protected final List getFilters() { + return this.filters; + } + +} diff --git a/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/DubboProcessAotMojo.java b/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/DubboProcessAotMojo.java new file mode 100644 index 0000000000..5b4f26b8b4 --- /dev/null +++ b/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/DubboProcessAotMojo.java @@ -0,0 +1,138 @@ +/* + * 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.dubbo.maven.plugin.aot; + + +import org.apache.commons.io.FileUtils; +import org.apache.maven.plugins.annotations.LifecyclePhase; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; +import org.apache.maven.plugins.annotations.ResolutionScope; +import org.apache.maven.project.MavenProject; + +import java.io.File; +import java.io.InputStream; +import java.net.URL; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +@Mojo(name = "dubbo-process-aot", defaultPhase = LifecyclePhase.PREPARE_PACKAGE, threadSafe = true, + requiresDependencyResolution = ResolutionScope.COMPILE_PLUS_RUNTIME, + requiresDependencyCollection = ResolutionScope.COMPILE_PLUS_RUNTIME) +public class DubboProcessAotMojo extends AbstractAotMojo { + + private static final String AOT_PROCESSOR_CLASS_NAME = "org.apache.dubbo.aot.generate.CodeGenerator"; + + /** + * Directory containing the classes and resource files that should be packaged into + * the archive. + */ + @Parameter(defaultValue = "${project.build.outputDirectory}", required = true) + private File classesDirectory; + + /** + * Directory containing the generated sources. + */ + @Parameter(defaultValue = "${project.build.directory}/dubbo-aot/main/sources", required = true) + private File generatedSources; + + /** + * Directory containing the generated resources. + */ + @Parameter(defaultValue = "${project.build.directory}/dubbo-aot/main/resources", required = true) + private File generatedResources; + + /** + * Directory containing the generated classes. + */ + @Parameter(defaultValue = "${project.build.directory}/dubbo-aot/main/classes", required = true) + private File generatedClasses; + + /** + * Name of the main class to use as the source for the AOT process. If not specified + * the first compiled class found that contains a 'main' method will be used. + */ + @Parameter(property = "dubbo.aot.main-class") + private String mainClass; + + + /** + * Application arguments that should be taken into account for AOT processing. + */ + @Parameter + private String[] arguments; + + + @Override + protected void executeAot() throws Exception { + URL[] classPath = getClassPath().toArray(new URL[0]); + generateAotAssets(classPath, AOT_PROCESSOR_CLASS_NAME, getAotArguments(mainClass)); + compileSourceFiles(classPath, this.generatedSources, this.classesDirectory); + copyNativeConfigFile(project); + copyAll(this.generatedResources.toPath(), this.classesDirectory.toPath()); + copyAll(this.generatedClasses.toPath(), this.classesDirectory.toPath()); + } + + private String[] getAotArguments(String applicationClass) { + List aotArguments = new ArrayList<>(); + aotArguments.add(applicationClass); + aotArguments.add(this.generatedSources.toString()); + aotArguments.add(this.generatedResources.toString()); + aotArguments.add(this.generatedClasses.toString()); + aotArguments.add(this.project.getGroupId()); + aotArguments.add(this.project.getArtifactId()); + aotArguments.addAll(new RunArguments(this.arguments).getArgs()); + return aotArguments.toArray(new String[0]); + } + + private List getClassPath() throws Exception { + File[] directories = new File[]{this.classesDirectory, this.generatedClasses}; + return getClassPath(directories, new ExcludeTestScopeArtifactFilter()); + } + + private void copyNativeConfigFile(MavenProject project) { + String[] nativeFiles = {"META-INF/native-image/reflect-config.json", + "META-INF/native-image/jni-config.json", + "META-INF/native-image/proxy-config.json", + "META-INF/native-image/resource-config.json", + "META-INF/native-image/serialization-config.json"}; + + Arrays.stream(nativeFiles).forEach(nativeFile -> { + InputStream is = this.getClass().getClassLoader().getResourceAsStream(nativeFile); + project.getResources().stream().findFirst().ifPresent(resource -> { + try { + String path = generatedResources + File.separator + "META-INF" + File.separator + "native-image" + File.separator + + File.separator + this.project.getGroupId() + File.separator + this.project.getArtifactId(); + FileUtils.forceMkdir(new File(path)); + String[] str = nativeFile.split("/"); + File file = new File(path + File.separator + str[str.length - 1]); + if (!file.exists()) { + FileUtils.copyInputStreamToFile(is, file); + getLog().info("Copy native config file:" + file); + } else { + getLog().info("Skip copy config file:" + file); + } + } catch (Throwable ex) { + getLog().error("Copy native config file error:" + ex.getMessage()); + } + }); + }); + } + + +} diff --git a/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/Exclude.java b/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/Exclude.java new file mode 100644 index 0000000000..ce1910577d --- /dev/null +++ b/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/Exclude.java @@ -0,0 +1,26 @@ +/* + * Copyright 2012-2019 the original author or authors. + * + * Licensed 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 + * + * https://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.dubbo.maven.plugin.aot; + +/** + * A model for a dependency to exclude. + * + * @author Stephane Nicoll + */ +public class Exclude extends FilterableDependency { + +} diff --git a/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/ExcludeFilter.java b/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/ExcludeFilter.java new file mode 100644 index 0000000000..841c9a303b --- /dev/null +++ b/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/ExcludeFilter.java @@ -0,0 +1,50 @@ +/* + * Copyright 2012-2019 the original author or authors. + * + * Licensed 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 + * + * https://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.dubbo.maven.plugin.aot; + +import org.apache.maven.artifact.Artifact; + +import java.util.Arrays; +import java.util.List; + +/** + * An {DependencyFilter} that filters out any artifact matching an {@link Exclude}. + * + * @author Stephane Nicoll + * @author David Turanski + */ +public class ExcludeFilter extends DependencyFilter { + + public ExcludeFilter(Exclude... excludes) { + this(Arrays.asList(excludes)); + } + + public ExcludeFilter(List excludes) { + super(excludes); + } + + @Override + protected boolean filter(Artifact artifact) { + for (FilterableDependency dependency : getFilters()) { + if (equals(artifact, dependency)) { + return true; + } + } + return false; + } + +} diff --git a/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/FilterableDependency.java b/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/FilterableDependency.java new file mode 100644 index 0000000000..58521297d8 --- /dev/null +++ b/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/FilterableDependency.java @@ -0,0 +1,70 @@ +/* + * Copyright 2012-2019 the original author or authors. + * + * Licensed 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 + * + * https://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.dubbo.maven.plugin.aot; + +import org.apache.maven.plugins.annotations.Parameter; + +/** + * A model for a dependency to include or exclude. + * + * @author Stephane Nicoll + * @author David Turanski + */ +abstract class FilterableDependency { + + /** + * The groupId of the artifact to exclude. + */ + @Parameter(required = true) + private String groupId; + + /** + * The artifactId of the artifact to exclude. + */ + @Parameter(required = true) + private String artifactId; + + /** + * The classifier of the artifact to exclude. + */ + @Parameter + private String classifier; + + String getGroupId() { + return this.groupId; + } + + void setGroupId(String groupId) { + this.groupId = groupId; + } + + String getArtifactId() { + return this.artifactId; + } + + void setArtifactId(String artifactId) { + this.artifactId = artifactId; + } + + String getClassifier() { + return this.classifier; + } + + void setClassifier(String classifier) { + this.classifier = classifier; + } + +} diff --git a/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/Include.java b/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/Include.java new file mode 100644 index 0000000000..1e27fc97e8 --- /dev/null +++ b/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/Include.java @@ -0,0 +1,26 @@ +/* + * Copyright 2012-2019 the original author or authors. + * + * Licensed 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 + * + * https://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.dubbo.maven.plugin.aot; + +/** + * A model for a dependency to include. + * + * @author David Turanski + */ +public class Include extends FilterableDependency { + +} diff --git a/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/IncludeFilter.java b/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/IncludeFilter.java new file mode 100644 index 0000000000..e2fd85014f --- /dev/null +++ b/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/IncludeFilter.java @@ -0,0 +1,46 @@ +/* + * Copyright 2012-2019 the original author or authors. + * + * Licensed 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 + * + * https://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.dubbo.maven.plugin.aot; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.shared.artifact.filter.collection.ArtifactsFilter; + +import java.util.List; + +/** + * An {@link ArtifactsFilter} that filters out any artifact not matching an + * {@link Include}. + * + * @author David Turanski + */ +public class IncludeFilter extends DependencyFilter { + + public IncludeFilter(List includes) { + super(includes); + } + + @Override + protected boolean filter(Artifact artifact) { + for (FilterableDependency dependency : getFilters()) { + if (equals(artifact, dependency)) { + return false; + } + } + return true; + } + +} diff --git a/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/JavaCompilerPluginConfiguration.java b/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/JavaCompilerPluginConfiguration.java new file mode 100644 index 0000000000..5f842ff853 --- /dev/null +++ b/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/JavaCompilerPluginConfiguration.java @@ -0,0 +1,107 @@ +/* + * Copyright 2012-2022 the original author or authors. + * + * Licensed 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 + * + * https://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.dubbo.maven.plugin.aot; + +import org.apache.maven.model.Plugin; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.util.xml.Xpp3Dom; + +import java.util.Arrays; + +/** + * Provides access to the Maven Java Compiler plugin configuration. + * + * @author Scott Frederick + */ +class JavaCompilerPluginConfiguration { + + private final MavenProject project; + + JavaCompilerPluginConfiguration(MavenProject project) { + this.project = project; + } + + String getSourceMajorVersion() { + String version = getConfigurationValue("source"); + + if (version == null) { + version = getPropertyValue("maven.compiler.source"); + } + + return majorVersionFor(version); + } + + String getTargetMajorVersion() { + String version = getConfigurationValue("target"); + + if (version == null) { + version = getPropertyValue("maven.compiler.target"); + } + + return majorVersionFor(version); + } + + String getReleaseVersion() { + String version = getConfigurationValue("release"); + + if (version == null) { + version = getPropertyValue("maven.compiler.release"); + } + + return majorVersionFor(version); + } + + private String getConfigurationValue(String propertyName) { + Plugin plugin = this.project.getPlugin("org.apache.maven.plugins:maven-compiler-plugin"); + if (plugin != null) { + Object pluginConfiguration = plugin.getConfiguration(); + if (pluginConfiguration instanceof Xpp3Dom) { + return getNodeValue((Xpp3Dom)pluginConfiguration, propertyName); + } + } + return null; + } + + private String getPropertyValue(String propertyName) { + if (this.project.getProperties().containsKey(propertyName)) { + return this.project.getProperties().get(propertyName).toString(); + } + return null; + } + + private String getNodeValue(Xpp3Dom dom, String... childNames) { + Xpp3Dom childNode = dom.getChild(childNames[0]); + + if (childNode == null) { + return null; + } + + if (childNames.length > 1) { + return getNodeValue(childNode, Arrays.copyOfRange(childNames, 1, childNames.length)); + } + + return childNode.getValue(); + } + + private String majorVersionFor(String version) { + if (version != null && version.startsWith("1.")) { + return version.substring("1.".length()); + } + return version; + } + +} diff --git a/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/JavaExecutable.java b/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/JavaExecutable.java new file mode 100644 index 0000000000..d8bafe2e04 --- /dev/null +++ b/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/JavaExecutable.java @@ -0,0 +1,71 @@ +/* + * Copyright 2012-2022 the original author or authors. + * + * Licensed 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 + * + * https://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.dubbo.maven.plugin.aot; + + +import org.apache.dubbo.common.utils.Assert; +import org.apache.dubbo.common.utils.StringUtils; + +import java.io.File; +import java.io.IOException; +import java.util.Arrays; + +/** + * Provides access to the java binary executable, regardless of OS. + * + * @author Phillip Webb + */ +public class JavaExecutable { + + private final File file; + + public JavaExecutable() { + String javaHome = System.getProperty("java.home"); + Assert.assertTrue(StringUtils.isNotEmpty(javaHome), "Unable to find java executable due to missing 'java.home'"); + this.file = findInJavaHome(javaHome); + } + + private File findInJavaHome(String javaHome) { + File bin = new File(new File(javaHome), "bin"); + File command = new File(bin, "java.exe"); + command = command.exists() ? command : new File(bin, "java"); + Assert.assertTrue(command.exists(), () -> "Unable to find java in " + javaHome); + return command; + } + + /** + * Create a new {@link ProcessBuilder} that will run with the Java executable. + * @param arguments the command arguments + * @return a {@link ProcessBuilder} + */ + public ProcessBuilder processBuilder(String... arguments) { + ProcessBuilder processBuilder = new ProcessBuilder(toString()); + processBuilder.command().addAll(Arrays.asList(arguments)); + return processBuilder; + } + + @Override + public String toString() { + try { + return this.file.getCanonicalPath(); + } + catch (IOException ex) { + throw new IllegalStateException(ex); + } + } + +} diff --git a/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/JavaProcessExecutor.java b/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/JavaProcessExecutor.java new file mode 100644 index 0000000000..7dda3cd3df --- /dev/null +++ b/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/JavaProcessExecutor.java @@ -0,0 +1,102 @@ +/* + * Copyright 2012-2022 the original author or authors. + * + * Licensed 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 + * + * https://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.dubbo.maven.plugin.aot; + +import org.apache.maven.execution.MavenSession; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.toolchain.Toolchain; +import org.apache.maven.toolchain.ToolchainManager; + +import java.io.File; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.function.Consumer; + +/** + * Ease the execution of a Java process using Maven's toolchain support. + * + * @author Stephane Nicoll + */ +class JavaProcessExecutor { + + private static final int EXIT_CODE_SIGINT = 130; + + private final MavenSession mavenSession; + + private final ToolchainManager toolchainManager; + + private final Consumer runProcessCustomizer; + + JavaProcessExecutor(MavenSession mavenSession, ToolchainManager toolchainManager) { + this(mavenSession, toolchainManager, null); + } + + private JavaProcessExecutor(MavenSession mavenSession, ToolchainManager toolchainManager, + Consumer runProcessCustomizer) { + this.mavenSession = mavenSession; + this.toolchainManager = toolchainManager; + this.runProcessCustomizer = runProcessCustomizer; + } + + JavaProcessExecutor withRunProcessCustomizer(Consumer customizer) { + Consumer combinedCustomizer = (this.runProcessCustomizer != null) + ? this.runProcessCustomizer.andThen(customizer) : customizer; + return new JavaProcessExecutor(this.mavenSession, this.toolchainManager, combinedCustomizer); + } + + int run(File workingDirectory, List args, Map environmentVariables) + throws MojoExecutionException { + RunProcess runProcess = new RunProcess(workingDirectory, getJavaExecutable()); + if (this.runProcessCustomizer != null) { + this.runProcessCustomizer.accept(runProcess); + } + try { + int exitCode = runProcess.run(true, args, environmentVariables); + if (!hasTerminatedSuccessfully(exitCode)) { + throw new MojoExecutionException("Process terminated with exit code: " + exitCode); + } + return exitCode; + } + catch (IOException ex) { + throw new MojoExecutionException("Process execution failed", ex); + } + } + + RunProcess runAsync(File workingDirectory, List args, Map environmentVariables) + throws MojoExecutionException { + try { + RunProcess runProcess = new RunProcess(workingDirectory, getJavaExecutable()); + runProcess.run(false, args, environmentVariables); + return runProcess; + } + catch (IOException ex) { + throw new MojoExecutionException("Process execution failed", ex); + } + } + + private boolean hasTerminatedSuccessfully(int exitCode) { + return (exitCode == 0 || exitCode == EXIT_CODE_SIGINT); + } + + private String getJavaExecutable() { + Toolchain toolchain = this.toolchainManager.getToolchainFromBuildContext("jdk", this.mavenSession); + String javaExecutable = (toolchain != null) ? toolchain.findTool("java") : null; + return (javaExecutable != null) ? javaExecutable : new JavaExecutable().toString(); + } + +} diff --git a/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/MatchingGroupIdFilter.java b/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/MatchingGroupIdFilter.java new file mode 100644 index 0000000000..9254c9271b --- /dev/null +++ b/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/MatchingGroupIdFilter.java @@ -0,0 +1,47 @@ +/* + * Copyright 2012-2019 the original author or authors. + * + * Licensed 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 + * + * https://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.dubbo.maven.plugin.aot; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.shared.artifact.filter.collection.AbstractArtifactFeatureFilter; + +/** + * An {@link org.apache.maven.shared.artifact.filter.collection.ArtifactsFilter + * ArtifactsFilter} that filters by matching groupId. + * + * Preferred over the + * {@link org.apache.maven.shared.artifact.filter.collection.GroupIdFilter} due to that + * classes use of {@link String#startsWith} to match on prefix. + * + * @author Mark Ingram + */ +public class MatchingGroupIdFilter extends AbstractArtifactFeatureFilter { + + /** + * Create a new instance with the CSV groupId values that should be excluded. + * @param exclude the group values to exclude + */ + public MatchingGroupIdFilter(String exclude) { + super("", exclude); + } + + @Override + protected String getArtifactFeature(Artifact artifact) { + return artifact.getGroupId(); + } + +} diff --git a/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/RunArguments.java b/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/RunArguments.java new file mode 100644 index 0000000000..224620533d --- /dev/null +++ b/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/RunArguments.java @@ -0,0 +1,68 @@ +/* + * Copyright 2012-2019 the original author or authors. + * + * Licensed 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 + * + * https://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.dubbo.maven.plugin.aot; + +import org.codehaus.plexus.util.cli.CommandLineUtils; + +import java.util.Arrays; +import java.util.Deque; +import java.util.LinkedList; +import java.util.Objects; + +/** + * Parse and expose arguments specified in a single string. + * + * @author Stephane Nicoll + */ +class RunArguments { + + private static final String[] NO_ARGS = {}; + + private final Deque args = new LinkedList<>(); + + RunArguments(String arguments) { + this(parseArgs(arguments)); + } + + RunArguments(String[] args) { + if (args != null) { + Arrays.stream(args).filter(Objects::nonNull).forEach(this.args::add); + } + } + + Deque getArgs() { + return this.args; + } + + String[] asArray() { + return this.args.toArray(new String[0]); + } + + private static String[] parseArgs(String arguments) { + if (arguments == null || arguments.trim().isEmpty()) { + return NO_ARGS; + } + try { + arguments = arguments.replace('\n', ' ').replace('\t', ' '); + return CommandLineUtils.translateCommandline(arguments); + } + catch (Exception ex) { + throw new IllegalArgumentException("Failed to parse arguments [" + arguments + "]", ex); + } + } + +} diff --git a/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/RunProcess.java b/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/RunProcess.java new file mode 100644 index 0000000000..621d4dbc5b --- /dev/null +++ b/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/RunProcess.java @@ -0,0 +1,169 @@ +/* + * Copyright 2012-2022 the original author or authors. + * + * Licensed 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 + * + * https://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.dubbo.maven.plugin.aot; + +import java.io.File; +import java.io.IOException; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Map; + +/** + * Utility used to run a process. + * + * @author Phillip Webb + * @author Dave Syer + * @author Andy Wilkinson + * @author Stephane Nicoll + * @author Dmytro Nosan + */ +public class RunProcess { + + private static final long JUST_ENDED_LIMIT = 500; + + private final File workingDirectory; + + private final String[] command; + + private volatile Process process; + + private volatile long endTime; + + /** + * Creates new {@link RunProcess} instance for the specified command. + * @param command the program to execute and its arguments + */ + public RunProcess(String... command) { + this(null, command); + } + + /** + * Creates new {@link RunProcess} instance for the specified working directory and + * command. + * @param workingDirectory the working directory of the child process or {@code null} + * to run in the working directory of the current Java process + * @param command the program to execute and its arguments + */ + public RunProcess(File workingDirectory, String... command) { + this.workingDirectory = workingDirectory; + this.command = command; + } + + public int run(boolean waitForProcess, String... args) throws IOException { + return run(waitForProcess, Arrays.asList(args), Collections.emptyMap()); + } + + public int run(boolean waitForProcess, Collection args, Map environmentVariables) + throws IOException { + ProcessBuilder builder = new ProcessBuilder(this.command); + builder.directory(this.workingDirectory); + builder.command().addAll(args); + builder.environment().putAll(environmentVariables); + builder.redirectErrorStream(true); + builder.inheritIO(); + try { + Process process = builder.start(); + this.process = process; + if (waitForProcess) { + try { + return process.waitFor(); + } + catch (InterruptedException ex) { + Thread.currentThread().interrupt(); + return 1; + } + } + return 5; + } + finally { + if (waitForProcess) { + this.endTime = System.currentTimeMillis(); + this.process = null; + } + } + } + + /** + * Return the running process. + * @return the process or {@code null} + */ + public Process getRunningProcess() { + return this.process; + } + + /** + * Return if the process was stopped. + * @return {@code true} if stopped + */ + public boolean handleSigInt() { + if (allowChildToHandleSigInt()) { + return true; + } + return doKill(); + } + + private boolean allowChildToHandleSigInt() { + Process process = this.process; + if (process == null) { + return true; + } + long end = System.currentTimeMillis() + 5000; + while (System.currentTimeMillis() < end) { + if (!process.isAlive()) { + return true; + } + try { + Thread.sleep(500); + } + catch (InterruptedException ex) { + Thread.currentThread().interrupt(); + return false; + } + } + return false; + } + + /** + * Kill this process. + */ + public void kill() { + doKill(); + } + + private boolean doKill() { + // destroy the running process + Process process = this.process; + if (process != null) { + try { + process.destroy(); + process.waitFor(); + this.process = null; + return true; + } + catch (InterruptedException ex) { + Thread.currentThread().interrupt(); + } + } + return false; + } + + public boolean hasJustEnded() { + return System.currentTimeMillis() < (this.endTime + JUST_ENDED_LIMIT); + } + +} diff --git a/dubbo-maven-plugin/src/main/resources/META-INF/native-image/jni-config.json b/dubbo-maven-plugin/src/main/resources/META-INF/native-image/jni-config.json new file mode 100644 index 0000000000..0d4f101c7a --- /dev/null +++ b/dubbo-maven-plugin/src/main/resources/META-INF/native-image/jni-config.json @@ -0,0 +1,2 @@ +[ +] diff --git a/dubbo-maven-plugin/src/main/resources/META-INF/native-image/proxy-config.json b/dubbo-maven-plugin/src/main/resources/META-INF/native-image/proxy-config.json new file mode 100644 index 0000000000..41b42e677b --- /dev/null +++ b/dubbo-maven-plugin/src/main/resources/META-INF/native-image/proxy-config.json @@ -0,0 +1,3 @@ +[ + +] diff --git a/dubbo-maven-plugin/src/main/resources/META-INF/native-image/reflect-config.json b/dubbo-maven-plugin/src/main/resources/META-INF/native-image/reflect-config.json new file mode 100644 index 0000000000..64b4fd5431 --- /dev/null +++ b/dubbo-maven-plugin/src/main/resources/META-INF/native-image/reflect-config.json @@ -0,0 +1,2925 @@ +[ + { + "name": "boolean", + "allPublicMethods": true + }, + { + "name": "com.intellij.rt.execution.application.AppMainV2$Agent", + "methods": [ + { + "name": "premain", + "parameterTypes": [ + "java.lang.String", + "java.lang.instrument.Instrumentation" + ] + } + ] + }, + { + "name": "io.netty.bootstrap.ServerBootstrap$1" + }, + { + "name": "io.netty.bootstrap.ServerBootstrap$ServerBootstrapAcceptor", + "methods": [ + { + "name": "channelRead", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.lang.Object" + ] + }, + { + "name": "exceptionCaught", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.lang.Throwable" + ] + } + ] + }, + { + "name": "io.netty.buffer.AbstractByteBufAllocator", + "allDeclaredMethods": true + }, + { + "name": "io.netty.buffer.AbstractReferenceCountedByteBuf", + "fields": [ + { + "name": "refCnt", + "allowUnsafeAccess": true + } + ] + }, + { + "name": "io.netty.channel.ChannelDuplexHandler", + "methods": [ + { + "name": "bind", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.net.SocketAddress", + "io.netty.channel.ChannelPromise" + ] + }, + { + "name": "close", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "io.netty.channel.ChannelPromise" + ] + }, + { + "name": "connect", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.net.SocketAddress", + "java.net.SocketAddress", + "io.netty.channel.ChannelPromise" + ] + }, + { + "name": "deregister", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "io.netty.channel.ChannelPromise" + ] + }, + { + "name": "disconnect", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "io.netty.channel.ChannelPromise" + ] + }, + { + "name": "flush", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + }, + { + "name": "read", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + } + ] + }, + { + "name": "io.netty.channel.ChannelHandlerAdapter", + "methods": [ + { + "name": "exceptionCaught", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.lang.Throwable" + ] + } + ] + }, + { + "name": "io.netty.channel.ChannelInboundHandlerAdapter", + "methods": [ + { + "name": "channelActive", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + }, + { + "name": "channelInactive", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + }, + { + "name": "channelRead", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.lang.Object" + ] + }, + { + "name": "channelReadComplete", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + }, + { + "name": "channelRegistered", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + }, + { + "name": "channelUnregistered", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + }, + { + "name": "channelWritabilityChanged", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + }, + { + "name": "exceptionCaught", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.lang.Throwable" + ] + }, + { + "name": "userEventTriggered", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.lang.Object" + ] + } + ] + }, + { + "name": "io.netty.channel.ChannelInitializer", + "methods": [ + { + "name": "channelRegistered", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + }, + { + "name": "exceptionCaught", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.lang.Throwable" + ] + } + ] + }, + { + "name": "io.netty.channel.ChannelOutboundHandlerAdapter", + "methods": [ + { + "name": "bind", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.net.SocketAddress", + "io.netty.channel.ChannelPromise" + ] + }, + { + "name": "close", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "io.netty.channel.ChannelPromise" + ] + }, + { + "name": "connect", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.net.SocketAddress", + "java.net.SocketAddress", + "io.netty.channel.ChannelPromise" + ] + }, + { + "name": "deregister", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "io.netty.channel.ChannelPromise" + ] + }, + { + "name": "disconnect", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "io.netty.channel.ChannelPromise" + ] + }, + { + "name": "flush", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + }, + { + "name": "read", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + } + ] + }, + { + "name": "io.netty.channel.DefaultChannelPipeline$HeadContext", + "methods": [ + { + "name": "bind", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.net.SocketAddress", + "io.netty.channel.ChannelPromise" + ] + }, + { + "name": "channelActive", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + }, + { + "name": "channelInactive", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + }, + { + "name": "channelRead", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.lang.Object" + ] + }, + { + "name": "channelReadComplete", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + }, + { + "name": "channelRegistered", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + }, + { + "name": "channelUnregistered", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + }, + { + "name": "channelWritabilityChanged", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + }, + { + "name": "close", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "io.netty.channel.ChannelPromise" + ] + }, + { + "name": "connect", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.net.SocketAddress", + "java.net.SocketAddress", + "io.netty.channel.ChannelPromise" + ] + }, + { + "name": "deregister", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "io.netty.channel.ChannelPromise" + ] + }, + { + "name": "disconnect", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "io.netty.channel.ChannelPromise" + ] + }, + { + "name": "exceptionCaught", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.lang.Throwable" + ] + }, + { + "name": "flush", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + }, + { + "name": "read", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + }, + { + "name": "userEventTriggered", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.lang.Object" + ] + }, + { + "name": "write", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.lang.Object", + "io.netty.channel.ChannelPromise" + ] + } + ] + }, + { + "name": "io.netty.channel.DefaultChannelPipeline$TailContext", + "methods": [ + { + "name": "channelActive", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + }, + { + "name": "channelInactive", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + }, + { + "name": "channelRead", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.lang.Object" + ] + }, + { + "name": "channelReadComplete", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + }, + { + "name": "channelRegistered", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + }, + { + "name": "channelUnregistered", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + }, + { + "name": "channelWritabilityChanged", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + }, + { + "name": "exceptionCaught", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.lang.Throwable" + ] + }, + { + "name": "userEventTriggered", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.lang.Object" + ] + } + ] + }, + { + "name": "io.netty.channel.socket.nio.NioServerSocketChannel", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "io.netty.channel.socket.nio.NioSocketChannel", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "io.netty.handler.codec.ByteToMessageDecoder", + "methods": [ + { + "name": "channelInactive", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + }, + { + "name": "channelRead", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.lang.Object" + ] + }, + { + "name": "channelReadComplete", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + }, + { + "name": "userEventTriggered", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.lang.Object" + ] + } + ] + }, + { + "name": "io.netty.handler.codec.MessageToByteEncoder", + "methods": [ + { + "name": "write", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.lang.Object", + "io.netty.channel.ChannelPromise" + ] + } + ] + }, + { + "name": "io.netty.handler.timeout.IdleStateHandler", + "methods": [ + { + "name": "channelActive", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + }, + { + "name": "channelInactive", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + }, + { + "name": "channelRead", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.lang.Object" + ] + }, + { + "name": "channelReadComplete", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + }, + { + "name": "channelRegistered", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + }, + { + "name": "write", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.lang.Object", + "io.netty.channel.ChannelPromise" + ] + } + ] + }, + { + "name": "io.netty.util.ReferenceCountUtil", + "allDeclaredMethods": true + }, + { + "name": "io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueColdProducerFields", + "fields": [ + { + "name": "producerLimit", + "allowUnsafeAccess": true + } + ] + }, + { + "name": "io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueConsumerFields", + "fields": [ + { + "name": "consumerIndex", + "allowUnsafeAccess": true + } + ] + }, + { + "name": "io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueProducerFields", + "fields": [ + { + "name": "producerIndex", + "allowUnsafeAccess": true + } + ] + }, + { + "name": "io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueConsumerIndexField", + "fields": [ + { + "name": "consumerIndex", + "allowUnsafeAccess": true + } + ] + }, + { + "name": "io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueProducerIndexField", + "fields": [ + { + "name": "producerIndex", + "allowUnsafeAccess": true + } + ] + }, + { + "name": "io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueProducerLimitField", + "fields": [ + { + "name": "producerLimit", + "allowUnsafeAccess": true + } + ] + }, + { + "name": "java.io.File", + "methods": [ + { + "name": "", + "parameterTypes": [ + "java.lang.String" + ] + } + ] + }, + { + "name": "java.io.Serializable", + "allDeclaredMethods": true + }, + { + "name": "java.lang.Cloneable", + "allDeclaredMethods": true + }, + { + "name": "java.lang.Comparable", + "allDeclaredMethods": true + }, + { + "name": "java.lang.Enum", + "allDeclaredFields": true, + "allDeclaredMethods": true + }, + { + "name": "java.lang.Integer", + "allDeclaredFields": true, + "allDeclaredMethods": true, + "allDeclaredConstructors": true + }, + { + "name": "java.lang.Number", + "allDeclaredFields": true, + "allDeclaredMethods": true + }, + { + "name": "java.lang.Object", + "allDeclaredFields": true, + "allDeclaredMethods": true, + "allPublicMethods": true + }, + { + "name": "java.lang.StackTraceElement", + "allDeclaredFields": true, + "allDeclaredMethods": true, + "allDeclaredConstructors": true + }, + { + "name": "java.lang.String" + }, + { + "name": "java.lang.String[]" + }, + { + "name": "java.lang.Thread", + "methods": [ + { + "name": "getContextClassLoader", + "parameterTypes": [] + } + ] + }, + { + "name": "java.lang.Throwable", + "fields": [ + { + "name": "detailMessage" + }, + { + "name": "stackTrace" + } + ] + }, + { + "name": "java.lang.management.ManagementFactory", + "methods": [ + { + "name": "getRuntimeMXBean", + "parameterTypes": [] + } + ] + }, + { + "name": "java.lang.management.RuntimeMXBean", + "methods": [ + { + "name": "getName", + "parameterTypes": [] + } + ] + }, + { + "name": "java.math.BigDecimal", + "methods": [ + { + "name": "", + "parameterTypes": [ + "java.lang.String" + ] + } + ] + }, + { + "name": "java.math.BigInteger", + "allDeclaredFields": true, + "allDeclaredMethods": true, + "allDeclaredConstructors": true + }, + { + "name": "java.net.URL", + "fields": [ + { + "name": "ref" + } + ] + }, + { + "name": "java.nio.Bits", + "methods": [ + { + "name": "unaligned", + "parameterTypes": [] + } + ] + }, + { + "name": "java.nio.Buffer", + "fields": [ + { + "name": "address", + "allowUnsafeAccess": true + } + ] + }, + { + "name": "java.nio.DirectByteBuffer", + "fields": [ + { + "name": "cleaner", + "allowUnsafeAccess": true + } + ], + "methods": [ + { + "name": "", + "parameterTypes": [ + "long", + "int" + ] + } + ] + }, + { + "name": "java.security.MessageDigestSpi" + }, + { + "name": "java.sql.Date", + "methods": [ + { + "name": "", + "parameterTypes": [ + "long" + ] + } + ] + }, + { + "name": "java.sql.Time", + "methods": [ + { + "name": "", + "parameterTypes": [ + "long" + ] + } + ] + }, + { + "name": "java.sql.Timestamp", + "methods": [ + { + "name": "", + "parameterTypes": [ + "long" + ] + } + ] + }, + { + "name": "java.time.Duration" + }, + { + "name": "java.time.Instant" + }, + { + "name": "java.time.LocalDate" + }, + { + "name": "java.time.LocalDateTime" + }, + { + "name": "java.time.LocalTime" + }, + { + "name": "java.time.MonthDay" + }, + { + "name": "java.time.OffsetDateTime" + }, + { + "name": "java.time.OffsetTime" + }, + { + "name": "java.time.Period" + }, + { + "name": "java.time.Year" + }, + { + "name": "java.time.YearMonth" + }, + { + "name": "java.time.ZoneId" + }, + { + "name": "java.time.ZoneOffset" + }, + { + "name": "java.time.ZonedDateTime" + }, + { + "name": "java.util.AbstractMap", + "allDeclaredFields": true, + "allDeclaredMethods": true + }, + { + "name": "java.util.ArrayList", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "java.util.BitSet", + "allDeclaredFields": true + }, + { + "name": "java.util.HashMap", + "allDeclaredMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "java.util.LinkedHashMap", + "allPublicConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "java.util.Map", + "allDeclaredMethods": true + }, + { + "name": "java.util.NavigableMap", + "allDeclaredMethods": true + }, + { + "name": "java.util.SortedMap", + "allDeclaredMethods": true + }, + { + "name": "java.util.TreeMap", + "allDeclaredFields": true, + "allDeclaredMethods": true, + "allDeclaredConstructors": true + }, + { + "name": "java.util.Map", + "allPublicConstructors": true + }, + { + "name": "java.util.concurrent.ConcurrentNavigableMap" + }, + { + "name": "java.util.concurrent.ConcurrentSkipListMap" + }, + { + "name": "javax.management.ObjectName", + "methods": [ + { + "name": "", + "parameterTypes": [ + "java.lang.String" + ] + } + ] + }, + { + "name": "org.apace.dubbo.graalvm.demo.DemoService", + "allPublicMethods": true + }, + { + "name": "org.apache.curator.x.discovery.ServiceType", + "allDeclaredFields": true, + "allDeclaredMethods": true, + "allDeclaredConstructors": true + }, + { + "name": "org.apache.curator.x.discovery.details.OldServiceInstance", + "allDeclaredFields": true, + "allDeclaredMethods": true, + "allDeclaredConstructors": true + }, + { + "name": "org.apache.dubbo.common.CommonScopeModelInitializer", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.common.serialize.hessian2.Hessian2ScopeModelInitializer", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.common.serialize.fastjson2.Fastjson2ScopeModelInitializer", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.common.URL", + "allDeclaredFields": true + }, + { + "name": "org.apache.dubbo.common.beans.ScopeBeanExtensionInjector", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.common.compiler.support.AdaptiveCompiler", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.common.compiler.support.JavassistCompiler", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.common.compiler.support.JdkCompiler", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.common.config.Environment", + "allPublicMethods": true, + "allPublicConstructors": true + }, + { + "name": "org.apache.dubbo.common.config.ModuleEnvironment", + "allPublicMethods": true, + "allPublicConstructors": true + }, + { + "name": "org.apache.dubbo.common.config.configcenter.file.FileSystemDynamicConfigurationFactory" + }, + { + "name": "org.apache.dubbo.common.config.configcenter.nop.NopDynamicConfigurationFactory" + }, + { + "name": "org.apache.dubbo.common.extension.inject.AdaptiveExtensionInjector", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.common.extension.inject.SpiExtensionInjector", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.common.infra.support.EnvironmentAdapter", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.common.lang.ShutdownHookCallbacks", + "allPublicConstructors": true + }, + { + "name": "org.apache.dubbo.common.logger.jcl.JclLoggerAdapter" + }, + { + "name": "org.apache.dubbo.common.logger.jdk.JdkLoggerAdapter", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.common.logger.log4j.Log4jLoggerAdapter", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.common.logger.log4j2.Log4j2LoggerAdapter" + }, + { + "name": "org.apache.dubbo.common.logger.slf4j.Slf4jLoggerAdapter" + }, + { + "name": "org.apache.dubbo.common.serialize.hessian2.Hessian2Serialization", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.common.serialize.hessian2.Hessian2FactoryManager", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.apache.dubbo.rpc.model.FrameworkModel" + ] + } + ] + }, + { + "name": "org.apache.dubbo.common.serialize.fastjson2.FastJson2Serialization", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.common.serialize.fastjson2.Fastjson2CreatorManager", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.apache.dubbo.rpc.model.FrameworkModel" + ] + } + ] + }, + { + "name": "org.apache.dubbo.common.serialize.fastjson2.Fastjson2SecurityManager", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.apache.dubbo.rpc.model.FrameworkModel" + ] + } + ] + }, + { + "name": "org.apache.dubbo.common.utils.SerializeSecurityConfigurator", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.apache.dubbo.rpc.model.ModuleModel" + ] + } + ] + }, + { + "name": "org.apache.dubbo.common.utils.SerializeSecurityManager", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [ + ] + } + ] + }, + { + "name": "org.apache.dubbo.common.utils.DefaultSerializeClassChecker", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.apache.dubbo.rpc.model.FrameworkModel" + ] + } + ] + }, + { + "name": "org.apache.dubbo.common.utils.SerializeClassChecker", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.common.status.reporter.FrameworkStatusReportService", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.common.threadpool.ThreadPool", + "allPublicMethods": true + }, + { + "name": "org.apache.dubbo.common.threadpool.ThreadPool$Adaptive", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.common.threadpool.manager.DefaultExecutorRepository", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.apache.dubbo.rpc.model.ApplicationModel" + ] + } + ] + }, + { + "name": "org.apache.dubbo.common.threadpool.support.cached.CachedThreadPool", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.common.threadpool.support.eager.EagerThreadPool" + }, + { + "name": "org.apache.dubbo.common.threadpool.support.fixed.FixedThreadPool", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.common.threadpool.support.limited.LimitedThreadPool" + }, + { + "name": "org.apache.dubbo.common.url.component.URLAddress", + "allDeclaredFields": true + }, + { + "name": "org.apache.dubbo.common.url.component.URLParam", + "allDeclaredFields": true + }, + { + "name": "org.apache.dubbo.common.url.component.param.DefaultDynamicParamSource", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.config.AbstractConfig", + "allPublicMethods": true + }, + { + "name": "org.apache.dubbo.config.AbstractInterfaceConfig", + "allPublicMethods": true + }, + { + "name": "org.apache.dubbo.config.AbstractMethodConfig", + "allPublicMethods": true + }, + { + "name": "org.apache.dubbo.config.AbstractReferenceConfig", + "allPublicMethods": true + }, + { + "name": "org.apache.dubbo.config.AbstractServiceConfig", + "allPublicMethods": true + }, + { + "name": "org.apache.dubbo.config.ApplicationConfig", + "allPublicMethods": true, + "fields": [ + { + "name": "monitor" + }, + { + "name": "registries" + } + ] + }, + { + "name": "org.apache.dubbo.config.ArgumentConfig", + "allPublicMethods": true + }, + { + "name": "org.apache.dubbo.config.ConfigCenterConfig", + "allPublicMethods": true, + "fields": [ + { + "name": "appExternalConfiguration" + }, + { + "name": "externalConfiguration" + } + ] + }, + { + "name": "org.apache.dubbo.config.ConfigScopeModelInitializer", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.config.ConsumerConfig", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.config.MethodConfig", + "allPublicMethods": true, + "fields": [ + { + "name": "arguments" + } + ] + }, + { + "name": "org.apache.dubbo.config.ModuleConfig", + "allPublicMethods": true, + "fields": [ + { + "name": "monitor" + }, + { + "name": "registries" + } + ], + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.config.ProtocolConfig", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.config.ProviderConfig", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.config.ReferenceConfig", + "allPublicMethods": true, + "fields": [ + { + "name": "invoker" + } + ] + }, + { + "name": "org.apache.dubbo.config.ReferenceConfigBase", + "allPublicMethods": true + }, + { + "name": "org.apache.dubbo.config.RegistryConfig", + "allPublicMethods": true + }, + { + "name": "org.apache.dubbo.config.ServiceConfig", + "allPublicMethods": true + }, + { + "name": "org.apache.dubbo.config.ServiceConfigBase", + "allPublicMethods": true + }, + { + "name": "org.apache.dubbo.config.SslConfig", + "allPublicMethods": true, + "fields": [ + { + "name": "clientKeyCertChainPathStream" + }, + { + "name": "clientPrivateKeyPathStream" + }, + { + "name": "clientTrustCertCollectionPathStream" + }, + { + "name": "serverKeyCertChainPathStream" + }, + { + "name": "serverPrivateKeyPathStream" + }, + { + "name": "serverTrustCertCollectionPathStream" + } + ], + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.config.context.ConfigManager", + "allPublicMethods": true, + "allPublicConstructors": true + }, + { + "name": "org.apache.dubbo.config.deploy.DefaultApplicationDeployer", + "allPublicConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.apache.dubbo.rpc.model.ApplicationModel" + ] + } + ] + }, + { + "name": "org.apache.dubbo.config.deploy.DefaultModuleDeployer", + "allPublicConstructors": true + }, + { + "name": "org.apache.dubbo.config.metadata.ConfigurableMetadataServiceExporter", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.config.metadata.ServiceInstanceHostPortCustomizer", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.config.utils.DefaultConfigValidator", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.configcenter.support.zookeeper.ZookeeperDynamicConfigurationFactory", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.apache.dubbo.rpc.model.ApplicationModel" + ] + } + ] + }, + { + "name": "org.apache.dubbo.demo.graalvm.provider.DemoServiceImpl", + "methods": [ + { + "name": "sayHello", + "parameterTypes": [ + "java.lang.String" + ] + } + ] + }, + { + "name": "org.apache.dubbo.metadata.InstanceMetadataChangedListener", + "allDeclaredFields": true + }, + { + "name": "org.apache.dubbo.metadata.MetadataInfo", + "allDeclaredFields": true + }, + { + "name": "org.apache.dubbo.metadata.MetadataInfo$ServiceInfo", + "allDeclaredFields": true + }, + { + "name": "org.apache.dubbo.metadata.MetadataService", + "allPublicMethods": true + }, + { + "name": "org.apache.dubbo.metadata.definition.builder.ArrayTypeBuilder", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.metadata.definition.builder.CollectionTypeBuilder", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.metadata.definition.builder.EnumTypeBuilder", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.metadata.definition.builder.MapTypeBuilder", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.metadata.definition.model.MethodDefinition", + "allDeclaredFields": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.metadata.definition.model.ServiceDefinition", + "allDeclaredFields": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.metadata.definition.model.TypeDefinition", + "allDeclaredFields": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.metadata.report.MetadataReportInstance", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.apache.dubbo.rpc.model.ApplicationModel" + ] + } + ] + }, + { + "name": "org.apache.dubbo.metadata.report.MetadataScopeModelInitializer", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.monitor.MetricsService", + "allPublicMethods": true + }, + { + "name": "org.apache.dubbo.monitor.MonitorService", + "allPublicMethods": true + }, + { + "name": "org.apache.dubbo.monitor.support.MetricsServiceDetector", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.monitor.support.MonitorFilter", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.monitor.support.MonitorClusterFilter", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.monitor.support.MonitorFilter" + }, + { + "name": "org.apache.dubbo.monitor.support.MonitorServiceDetector", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.registry.RegistryFactory", + "allPublicMethods": true + }, + { + "name": "org.apache.dubbo.registry.RegistryFactory$Adaptive", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.registry.RegistryFactoryWrapper", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.apache.dubbo.registry.RegistryFactory" + ] + } + ] + }, + { + "name": "org.apache.dubbo.registry.RegistryScopeModelInitializer", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.registry.client.DefaultRegistryClusterIdentifier", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.registry.client.DefaultServiceInstance$Endpoint", + "allDeclaredFields": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.registry.client.ServiceDiscoveryRegistryFactory", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.registry.client.metadata.MetadataServiceNameMapping", + "allPublicMethods": true, + "allPublicConstructors": true + }, + { + "name": "org.apache.dubbo.registry.client.metadata.MetadataServiceURLParamsMetadataCustomizer", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.registry.client.metadata.ProtocolPortsMetadataCustomizer", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.registry.client.metadata.ServiceInstanceMetadataCustomizer", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.registry.client.metadata.store.InMemoryWritableMetadataService", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.registry.client.metadata.store.RemoteMetadataServiceImpl", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.registry.client.migration.DefaultMigrationAddressComparator", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.registry.client.migration.MigrationRuleListener", + "allPublicMethods": true, + "allPublicConstructors": true + }, + { + "name": "org.apache.dubbo.registry.integration.InterfaceCompatibleRegistryProtocol", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.registry.integration.RegistryProtocol", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.registry.multicast.MulticastRegistryFactory" + }, + { + "name": "org.apache.dubbo.registry.multicast.MulticastServiceDiscoveryFactory" + }, + { + "name": "org.apache.dubbo.registry.support.DefaultProviderFirstParams", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.registry.support.RegistryManager", + "allPublicConstructors": true + }, + { + "name": "org.apache.dubbo.registry.zookeeper.ZookeeperInstance", + "allDeclaredFields": true, + "allDeclaredMethods": true, + "allDeclaredConstructors": true + }, + { + "name": "org.apache.dubbo.registry.zookeeper.ZookeeperRegistryFactory", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.registry.zookeeper.ZookeeperServiceDiscoveryFactory", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.remoting.Dispatcher", + "allPublicMethods": true + }, + { + "name": "org.apache.dubbo.remoting.Dispatcher$Adaptive", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.remoting.Transporter", + "allPublicMethods": true + }, + { + "name": "org.apache.dubbo.remoting.Transporter$Adaptive", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.remoting.exchange.codec.ExchangeCodec" + }, + { + "name": "org.apache.dubbo.remoting.exchange.support.header.HeaderExchanger", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.remoting.telnet.codec.TelnetCodec" + }, + { + "name": "org.apache.dubbo.remoting.transport.codec.TransportCodec" + }, + { + "name": "org.apache.dubbo.remoting.transport.dispatcher.all.AllDispatcher", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.remoting.transport.dispatcher.connection.ConnectionOrderedDispatcher" + }, + { + "name": "org.apache.dubbo.remoting.transport.dispatcher.direct.DirectDispatcher" + }, + { + "name": "org.apache.dubbo.remoting.transport.dispatcher.execution.ExecutionDispatcher" + }, + { + "name": "org.apache.dubbo.remoting.transport.dispatcher.message.MessageOnlyDispatcher" + }, + { + "name": "org.apache.dubbo.remoting.transport.netty4.NettyClient$1" + }, + { + "name": "org.apache.dubbo.remoting.transport.netty4.NettyClientHandler", + "methods": [ + { + "name": "channelActive", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + }, + { + "name": "channelInactive", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + }, + { + "name": "channelRead", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.lang.Object" + ] + }, + { + "name": "exceptionCaught", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.lang.Throwable" + ] + }, + { + "name": "userEventTriggered", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.lang.Object" + ] + }, + { + "name": "write", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.lang.Object", + "io.netty.channel.ChannelPromise" + ] + } + ] + }, + { + "name": "org.apache.dubbo.remoting.transport.netty4.NettyCodecAdapter$InternalDecoder" + }, + { + "name": "org.apache.dubbo.remoting.transport.netty4.NettyCodecAdapter$InternalEncoder" + }, + { + "name": "org.apache.dubbo.remoting.transport.netty4.NettyServer$1" + }, + { + "name": "org.apache.dubbo.remoting.transport.netty4.NettyServerHandler", + "methods": [ + { + "name": "channelActive", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + }, + { + "name": "channelInactive", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + }, + { + "name": "channelRead", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.lang.Object" + ] + }, + { + "name": "exceptionCaught", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.lang.Throwable" + ] + }, + { + "name": "userEventTriggered", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.lang.Object" + ] + }, + { + "name": "write", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.lang.Object", + "io.netty.channel.ChannelPromise" + ] + } + ] + }, + { + "name": "org.apache.dubbo.remoting.transport.netty4.NettyTransporter", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.remoting.zookeeper.curator.CuratorZookeeperTransporter", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.remoting.zookeeper.curator5.Curator5ZookeeperTransporter", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.Invoker", + "allPublicMethods": true + }, + { + "name": "org.apache.dubbo.rpc.Protocol", + "allPublicMethods": true + }, + { + "name": "org.apache.dubbo.rpc.Protocol$Adaptive", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.ProxyFactory", + "allPublicMethods": true + }, + { + "name": "org.apache.dubbo.rpc.ProxyFactory$Adaptive", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.cluster.Cluster", + "allPublicMethods": true + }, + { + "name": "org.apache.dubbo.rpc.cluster.Cluster$Adaptive", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.cluster.ClusterScopeModelInitializer", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.cluster.ConfiguratorFactory", + "allPublicMethods": true + }, + { + "name": "org.apache.dubbo.rpc.cluster.ConfiguratorFactory$Adaptive", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.cluster.Directory", + "allPublicMethods": true + }, + { + "name": "org.apache.dubbo.rpc.cluster.RouterFactory", + "allPublicMethods": true + }, + { + "name": "org.apache.dubbo.rpc.cluster.RouterFactory$Adaptive", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.cluster.configurator.absent.AbsentConfiguratorFactory" + }, + { + "name": "org.apache.dubbo.rpc.cluster.configurator.override.OverrideConfiguratorFactory" + }, + { + "name": "org.apache.dubbo.rpc.cluster.filter.DefaultFilterChainBuilder", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.cluster.filter.ProtocolFilterWrapper", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.apache.dubbo.rpc.Protocol" + ] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.cluster.filter.support.ConsumerContextFilter", + "allPublicMethods": true, + "allPublicConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.apache.dubbo.rpc.model.ApplicationModel" + ] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.cluster.filter.support.ZoneAwareFilter" + }, + { + "name": "org.apache.dubbo.rpc.cluster.governance.DefaultGovernanceRuleRepositoryImpl", + "allPublicMethods": true, + "allPublicConstructors": true + }, + { + "name": "org.apache.dubbo.rpc.cluster.loadbalance.ConsistentHashLoadBalance" + }, + { + "name": "org.apache.dubbo.rpc.cluster.loadbalance.LeastActiveLoadBalance" + }, + { + "name": "org.apache.dubbo.rpc.cluster.loadbalance.RandomLoadBalance", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.cluster.loadbalance.RoundRobinLoadBalance" + }, + { + "name": "org.apache.dubbo.rpc.cluster.loadbalance.ShortestResponseLoadBalance" + }, + { + "name": "org.apache.dubbo.rpc.cluster.merger.MergerFactory", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.cluster.support.ClusterUtils", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.filter.AccessLogFilter" + }, + { + "name": "org.apache.dubbo.rpc.filter.ClassLoaderFilter", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.filter.CompatibleFilter" + }, + { + "name": "org.apache.dubbo.rpc.filter.ContextFilter", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.apache.dubbo.rpc.model.ApplicationModel" + ] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.filter.DeprecatedFilter" + }, + { + "name": "org.apache.dubbo.rpc.filter.EchoFilter", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.filter.ExceptionFilter", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.filter.ExecuteLimitFilter" + }, + { + "name": "org.apache.dubbo.rpc.filter.GenericFilter", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.filter.GenericImplFilter", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.apache.dubbo.rpc.model.ModuleModel" + ] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.filter.TimeoutFilter", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.cluster.router.condition.ConditionRouterFactory" + }, + { + "name": "org.apache.dubbo.rpc.cluster.router.condition.config.AppStateRouterFactory", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.cluster.router.condition.config.ServiceStateRouterFactory", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.cluster.router.file.FileStateRouterFactory" + }, + { + "name": "org.apache.dubbo.rpc.cluster.router.mesh.route.MeshRuleAddressListenerInterceptor", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.cluster.router.mesh.route.StandardMeshRuleRouterFactory", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.cluster.router.mock.MockStateRouterFactory", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.cluster.router.tag.TagDynamicStateRouterFactory", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.cluster.router.tag.TagRouterFactory", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.cluster.router.tag.TagStaticStateRouterFactory", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.cluster.support.AvailableCluster" + }, + { + "name": "org.apache.dubbo.rpc.cluster.support.BroadcastCluster" + }, + { + "name": "org.apache.dubbo.rpc.cluster.support.ClusterUtils", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.cluster.support.FailbackCluster" + }, + { + "name": "org.apache.dubbo.rpc.cluster.support.FailfastCluster" + }, + { + "name": "org.apache.dubbo.rpc.cluster.support.FailoverCluster", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.cluster.support.FailsafeCluster" + }, + { + "name": "org.apache.dubbo.rpc.cluster.support.ForkingCluster" + }, + { + "name": "org.apache.dubbo.rpc.cluster.support.MergeableCluster" + }, + { + "name": "org.apache.dubbo.rpc.cluster.support.merger.DefaultProviderURLMergeProcessor", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.cluster.support.registry.ZoneAwareCluster" + }, + { + "name": "org.apache.dubbo.rpc.cluster.support.wrapper.MockClusterWrapper", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.apache.dubbo.rpc.cluster.Cluster" + ] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.filter.AccessLogFilter" + }, + { + "name": "org.apache.dubbo.rpc.filter.ClassLoaderFilter" + }, + { + "name": "org.apache.dubbo.rpc.filter.CompatibleFilter" + }, + { + "name": "org.apache.dubbo.rpc.filter.DeprecatedFilter" + }, + { + "name": "org.apache.dubbo.rpc.filter.EchoFilter" + }, + { + "name": "org.apache.dubbo.rpc.filter.ExceptionFilter" + }, + { + "name": "org.apache.dubbo.rpc.filter.ExecuteLimitFilter" + }, + { + "name": "org.apache.dubbo.rpc.filter.GenericFilter" + }, + { + "name": "org.apache.dubbo.rpc.filter.TimeoutFilter" + }, + { + "name": "org.apache.dubbo.rpc.filter.TokenFilter" + }, + { + "name": "org.apache.dubbo.rpc.filter.TpsLimitFilter" + }, + { + "name": "org.apache.dubbo.rpc.listener.DeprecatedInvokerListener" + }, + { + "name": "org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.apache.dubbo.rpc.Protocol" + ] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.protocol.ProtocolSerializationWrapper", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.apache.dubbo.rpc.Protocol" + ] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.protocol.dubbo.DubboCountCodec", + "allPublicMethods": true, + "allPublicConstructors": true + }, + { + "name": "org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.apache.dubbo.rpc.model.FrameworkModel" + ] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.AdaptiveMetrics", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.protocol.dubbo.filter.FutureFilter", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.protocol.dubbo.filter.TraceFilter", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.protocol.dubbo.filter.TraceFilter" + }, + { + "name": "org.apache.dubbo.rpc.protocol.injvm.InjvmProtocol", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.proxy.javassist.JavassistProxyFactory" + }, + { + "name": "org.apache.dubbo.rpc.proxy.jdk.JdkProxyFactory", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.proxy.wrapper.StubProxyFactoryWrapper", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.apache.dubbo.rpc.ProxyFactory" + ] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.service.Destroyable", + "allPublicMethods": true + }, + { + "name": "org.apache.dubbo.rpc.service.EchoService", + "allPublicMethods": true + }, + { + "name": "org.apache.dubbo.rpc.service.EchoServiceDetector", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.service.GenericService", + "allPublicMethods": true + }, + { + "name": "org.apache.dubbo.rpc.service.GenericServiceDetector", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.support.MockProtocol" + }, + { + "name": "org.apache.log4j.Appender" + }, + { + "name": "org.apache.log4j.Category" + }, + { + "name": "org.apache.log4j.CategoryKey" + }, + { + "name": "org.apache.log4j.ConsoleAppender", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.log4j.Layout", + "allPublicMethods": true + }, + { + "name": "org.apache.log4j.Logger" + }, + { + "name": "org.apache.log4j.PatternLayout", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.logging.log4j.Level", + "allPublicMethods": true + }, + { + "name": "org.apache.log4j.helpers.Loader" + }, + { + "name": "org.apache.log4j.spi.OptionHandler" + }, + { + "name": "org.apache.zookeeper.ClientCnxnSocketNIO", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.apache.zookeeper.client.ZKClientConfig" + ] + }, + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "sun.misc.Cleaner", + "methods": [ + { + "name": "clean", + "parameterTypes": [] + } + ] + }, + { + "name": "sun.misc.Unsafe", + "fields": [ + { + "name": "theUnsafe" + } + ], + "methods": [ + { + "name": "copyMemory", + "parameterTypes": [ + "java.lang.Object", + "long", + "java.lang.Object", + "long", + "long" + ] + }, + { + "name": "getAndAddLong", + "parameterTypes": [ + "java.lang.Object", + "long", + "long" + ] + }, + { + "name": "getAndSetObject", + "parameterTypes": [ + "java.lang.Object", + "long", + "java.lang.Object" + ] + } + ] + }, + { + "name": "sun.misc.VM", + "methods": [ + { + "name": "maxDirectMemory", + "parameterTypes": [] + } + ] + }, + { + "name": "sun.nio.ch.SelectorImpl", + "fields": [ + { + "name": "publicSelectedKeys" + }, + { + "name": "selectedKeys" + } + ] + }, + { + "name": "sun.security.provider.ConfigFile", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "sun.security.provider.MD5", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "sun.security.provider.NativePRNG", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "sun.security.provider.SHA", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "sun.security.provider.Sun", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.cluster.router.RouterSnapshotSwitcher", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.common.threadpool.manager.FrameworkExecutorRepository", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.common.convert.ConverterUtil", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.apache.dubbo.rpc.model.FrameworkModel" + ] + } + ] + }, + { + "name": "org.apache.dubbo.rpc.cluster.router.mesh.route.MeshRuleManager", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.apache.dubbo.rpc.model.ModuleModel" + ] + } + ] + }, + { + "name": "org.apache.dubbo.config.context.ModuleConfigManager", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.apache.dubbo.rpc.model.ModuleModel" + ] + } + ] + }, + { + "name": "org.apache.dubbo.common.store.support.SimpleDataStore", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.metrics.collector.DefaultMetricsCollector", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.dubbo.config.deploy.DefaultMetricsServiceExporter", + "allPublicMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "com.alibaba.fastjson.JSON", + "allPublicMethods": true + }, + { + "name": "java.util.Collections$UnmodifiableMap", + "allPublicMethods": true + }, + { + "name": "java.util.Collections$UnmodifiableCollection", + "allPublicMethods": true + } +] diff --git a/dubbo-maven-plugin/src/main/resources/META-INF/native-image/resource-config.json b/dubbo-maven-plugin/src/main/resources/META-INF/native-image/resource-config.json new file mode 100644 index 0000000000..51f17b21af --- /dev/null +++ b/dubbo-maven-plugin/src/main/resources/META-INF/native-image/resource-config.json @@ -0,0 +1,169 @@ +{ + "resources": { + "includes": [ + { + "pattern": "\\QDENY_CLASS\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.common.compiler.Compiler\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.common.config.configcenter.DynamicConfigurationFactory\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.common.context.ApplicationExt\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.common.context.ModuleExt\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.common.extension.ExtensionInjector\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.common.infra.InfraAdapter\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.common.logger.LoggerAdapter\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.common.serialize.Serialization\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.common.threadpool.ThreadPool\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.common.threadpool.manager.ExecutorRepository\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.common.url.component.param.DynamicParamSource\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.metadata.MetadataServiceExporter\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.metadata.ServiceNameMapping\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.metadata.definition.builder.TypeBuilder\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.registry.AddressListener\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.registry.ProviderFirstParams\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.registry.RegistryFactory\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.registry.client.RegistryClusterIdentifier\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.registry.client.ServiceDiscoveryFactory\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.registry.client.ServiceInstanceCustomizer\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.registry.client.migration.MigrationAddressComparator\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.registry.integration.RegistryProtocolListener\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.remoting.Codec2\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.remoting.Dispatcher\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.remoting.Transporter\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.remoting.exchange.Exchanger\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.remoting.zookeeper.ZookeeperTransporter\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.rpc.Filter\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.rpc.InvokerListener\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.rpc.Protocol\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.rpc.ProxyFactory\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.rpc.cluster.Cluster\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.rpc.cluster.ConfiguratorFactory\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.rpc.cluster.LoadBalance\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.rpc.cluster.ProviderURLMergeProcessor\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.rpc.cluster.RouterFactory\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.rpc.cluster.filter.ClusterFilter\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.rpc.cluster.governance.GovernanceRuleRepository\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.rpc.cluster.router.state.StateRouterFactory\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.rpc.model.BuiltinServiceDetector\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.rpc.model.ScopeModelInitializer\\E" + }, + { + "pattern": "\\QMETA-INF/services/org.apache.dubbo.common.extension.LoadingStrategy\\E" + }, + { + "pattern": "\\Qdubbo.properties\\E" + }, + { + "pattern": "\\Qlog4j.properties\\E" + }, + { + "pattern": "\\Qorg/apache/dubbo/common/Version.class\\E" + }, + { + "pattern": "\\Qorg/apache/dubbo/remoting/RemotingException.class\\E" + }, + { + "pattern": "\\Qorg/apache/dubbo/remoting/Transporters.class\\E" + }, + { + "pattern": "\\Qorg/apache/dubbo/remoting/exchange/Exchangers.class\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.common.store.DataStore\\E" + }, + { + "pattern": "\\QMETA-INF/dubbo/internal/org.apache.dubbo.metrics.service.MetricsServiceExporter\\E" + }, + { + "pattern": "\\Qsecurity/serialize.blockedlist\\E" + }, + { + "pattern": "\\Qsecurity/serialize.allowlist\\E" + } + ] + }, + "bundles": [] +} diff --git a/dubbo-maven-plugin/src/main/resources/META-INF/native-image/serialization-config.json b/dubbo-maven-plugin/src/main/resources/META-INF/native-image/serialization-config.json new file mode 100644 index 0000000000..0d4f101c7a --- /dev/null +++ b/dubbo-maven-plugin/src/main/resources/META-INF/native-image/serialization-config.json @@ -0,0 +1,2 @@ +[ +] diff --git a/dubbo-native-plugin/src/main/java/org/apache/dubbo/common/metrics/MetricsReporterFactory$Adaptive.java b/dubbo-native-plugin/src/main/java/org/apache/dubbo/common/metrics/MetricsReporterFactory$Adaptive.java deleted file mode 100644 index ed54214c78..0000000000 --- a/dubbo-native-plugin/src/main/java/org/apache/dubbo/common/metrics/MetricsReporterFactory$Adaptive.java +++ /dev/null @@ -1,33 +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.dubbo.common.metrics; - -import org.apache.dubbo.metrics.report.MetricsReporter; -import org.apache.dubbo.metrics.report.MetricsReporterFactory; -import org.apache.dubbo.rpc.model.ScopeModel; -import org.apache.dubbo.rpc.model.ScopeModelUtil; -public class MetricsReporterFactory$Adaptive implements MetricsReporterFactory { -public MetricsReporter createMetricsReporter(org.apache.dubbo.common.URL arg0) { -if (arg0 == null) throw new IllegalArgumentException("url == null"); -org.apache.dubbo.common.URL url = arg0; -String extName = ( url.getProtocol() == null ? "nop" : url.getProtocol() ); -if(extName == null) throw new IllegalStateException("Failed to get extension (MetricsReporterFactory) name from url (" + url.toString() + ") use keys([protocol])"); -ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), MetricsReporterFactory.class); -MetricsReporterFactory extension = (MetricsReporterFactory)scopeModel.getExtensionLoader(MetricsReporterFactory.class).getExtension(extName); -return extension.createMetricsReporter(arg0); -} -} diff --git a/dubbo-native-plugin/src/main/java/org/apache/dubbo/common/threadpool/ThreadPool$Adaptive.java b/dubbo-native-plugin/src/main/java/org/apache/dubbo/common/threadpool/ThreadPool$Adaptive.java deleted file mode 100644 index 194958ed19..0000000000 --- a/dubbo-native-plugin/src/main/java/org/apache/dubbo/common/threadpool/ThreadPool$Adaptive.java +++ /dev/null @@ -1,30 +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.dubbo.common.threadpool; -import org.apache.dubbo.rpc.model.ScopeModel; -import org.apache.dubbo.rpc.model.ScopeModelUtil; -public class ThreadPool$Adaptive implements org.apache.dubbo.common.threadpool.ThreadPool { -public java.util.concurrent.Executor getExecutor(org.apache.dubbo.common.URL arg0) { -if (arg0 == null) throw new IllegalArgumentException("url == null"); -org.apache.dubbo.common.URL url = arg0; -String extName = url.getParameter("threadpool", "fixed"); -if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.common.threadpool.ThreadPool) name from url (" + url.toString() + ") use keys([threadpool])"); -ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.common.threadpool.ThreadPool.class); -org.apache.dubbo.common.threadpool.ThreadPool extension = (org.apache.dubbo.common.threadpool.ThreadPool)scopeModel.getExtensionLoader(org.apache.dubbo.common.threadpool.ThreadPool.class).getExtension(extName); -return extension.getExecutor(arg0); -} -} diff --git a/dubbo-native-plugin/src/main/java/org/apache/dubbo/rpc/executor/IsolationExecutorSupportFactory$Adaptive.java b/dubbo-native-plugin/src/main/java/org/apache/dubbo/rpc/executor/IsolationExecutorSupportFactory$Adaptive.java deleted file mode 100644 index 6360d71c54..0000000000 --- a/dubbo-native-plugin/src/main/java/org/apache/dubbo/rpc/executor/IsolationExecutorSupportFactory$Adaptive.java +++ /dev/null @@ -1,33 +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.dubbo.rpc.executor; -import org.apache.dubbo.rpc.model.ScopeModel; -import org.apache.dubbo.rpc.model.ScopeModelUtil; -public class IsolationExecutorSupportFactory$Adaptive implements org.apache.dubbo.rpc.executor.IsolationExecutorSupportFactory { -public org.apache.dubbo.rpc.executor.ExecutorSupport getIsolationExecutorSupport(org.apache.dubbo.common.URL arg0) { -throw new UnsupportedOperationException("The method public static org.apache.dubbo.rpc.executor.ExecutorSupport org.apache.dubbo.rpc.executor.IsolationExecutorSupportFactory.getIsolationExecutorSupport(org.apache.dubbo.common.URL) of interface org.apache.dubbo.rpc.executor.IsolationExecutorSupportFactory is not adaptive method!"); -} -public org.apache.dubbo.rpc.executor.ExecutorSupport createIsolationExecutorSupport(org.apache.dubbo.common.URL arg0) { -if (arg0 == null) throw new IllegalArgumentException("url == null"); -org.apache.dubbo.common.URL url = arg0; -String extName = ( url.getProtocol() == null ? "adaptive" : url.getProtocol() ); -if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.rpc.executor.IsolationExecutorSupportFactory) name from url (" + url.toString() + ") use keys([protocol])"); -ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.rpc.executor.IsolationExecutorSupportFactory.class); -org.apache.dubbo.rpc.executor.IsolationExecutorSupportFactory extension = (org.apache.dubbo.rpc.executor.IsolationExecutorSupportFactory)scopeModel.getExtensionLoader(org.apache.dubbo.rpc.executor.IsolationExecutorSupportFactory.class).getExtension(extName); -return extension.createIsolationExecutorSupport(arg0); -} -} diff --git a/dubbo-native/pom.xml b/dubbo-native/pom.xml index 73e37cb332..449148f20a 100644 --- a/dubbo-native/pom.xml +++ b/dubbo-native/pom.xml @@ -30,51 +30,11 @@ - org.apache.dubbo dubbo-common ${project.parent.version} - - - - org.apache.dubbo - dubbo-metadata-api - ${project.parent.version} - - - - - org.apache.dubbo - dubbo-monitor-api - ${project.parent.version} - - - - org.apache.dubbo - dubbo-registry-api - ${project.parent.version} - - - - - org.apache.dubbo - dubbo-remoting-zookeeper - ${project.parent.version} - - - - org.apache.dubbo - dubbo-test-check - ${project.parent.version} - test - - - org.apache.dubbo - dubbo-metrics-default - ${project.parent.version} - diff --git a/dubbo-native/src/main/java/org/apache/dubbo/utils/ClassFinder.java b/dubbo-native/src/main/java/org/apache/dubbo/aot/generate/ClassSourceFinder.java similarity index 95% rename from dubbo-native/src/main/java/org/apache/dubbo/utils/ClassFinder.java rename to dubbo-native/src/main/java/org/apache/dubbo/aot/generate/ClassSourceFinder.java index 75ef3277e8..545c427442 100644 --- a/dubbo-native/src/main/java/org/apache/dubbo/utils/ClassFinder.java +++ b/dubbo-native/src/main/java/org/apache/dubbo/aot/generate/ClassSourceFinder.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.dubbo.utils; +package org.apache.dubbo.aot.generate; import java.io.File; @@ -26,7 +26,7 @@ import java.util.Set; import java.util.jar.JarEntry; import java.util.jar.JarFile; -public class ClassFinder { +public class ClassSourceFinder { public Set findClassSet(String packageName) { packageName = packageName.replace(".", "/"); @@ -42,7 +42,7 @@ public class ClassFinder { findClassesByFile(packageName, resource.getPath(), result); } else if ("jar".equals(protocol)) { JarFile jar = ((JarURLConnection) resource.openConnection()).getJarFile(); - System.out.println("findClassSet jar:"+jar.getName()); + System.out.println("findClassSet jar:" + jar.getName()); findClassesByJar(packageName, jar, result); } } diff --git a/dubbo-native/src/main/java/org/apache/dubbo/utils/CodeGenerator.java b/dubbo-native/src/main/java/org/apache/dubbo/aot/generate/CodeGenerator.java similarity index 81% rename from dubbo-native/src/main/java/org/apache/dubbo/utils/CodeGenerator.java rename to dubbo-native/src/main/java/org/apache/dubbo/aot/generate/CodeGenerator.java index aae60bb5b2..2e6a68cb97 100644 --- a/dubbo-native/src/main/java/org/apache/dubbo/utils/CodeGenerator.java +++ b/dubbo-native/src/main/java/org/apache/dubbo/aot/generate/CodeGenerator.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.dubbo.utils; +package org.apache.dubbo.aot.generate; import org.apache.dubbo.common.extension.Adaptive; import org.apache.dubbo.common.extension.AdaptiveClassCodeGenerator; @@ -27,7 +27,6 @@ import java.io.File; import java.io.IOException; import java.lang.annotation.Annotation; import java.lang.reflect.Method; -import java.net.URL; import java.nio.charset.Charset; import java.nio.file.Paths; import java.util.ArrayList; @@ -42,13 +41,12 @@ import java.util.stream.Collectors; */ public class CodeGenerator { - public static void main(String[] args) { - URL r = Thread.currentThread().getContextClassLoader().getResource(""); - String targetClassPath = new File(r.getFile()).getAbsolutePath(); - String p = Paths.get(targetClassPath).getParent().getParent().toString() + File.separator + "src" + File.separator + "main" + File.separator + "java"; - System.out.println(p); + private static final String PACKAGE_NAME_PREFIX = "org.apache.dubbo"; - List> classes = new ClassFinder().findClassSet("org.apache.dubbo").stream().map(it -> { + public static void main(String[] args) { + String generatedSources = args[1]; + + List> classes = new ClassSourceFinder().findClassSet(PACKAGE_NAME_PREFIX).stream().map(it -> { try { return Class.forName(it); } catch (Throwable e) { @@ -73,23 +71,20 @@ public class CodeGenerator { } AdaptiveClassCodeGenerator codeGenerator = new AdaptiveClassCodeGenerator(it, value); String code = codeGenerator.generate(true); - System.out.println(code); - System.out.println("-----:" + it.getPackage()); try { - String file = p + File.separator + it.getName().replaceAll("\\.", Matcher.quoteReplacement(File.separator)); + String file = generatedSources + File.separator + it.getName().replaceAll("\\.", Matcher.quoteReplacement(File.separator)); String dir = Paths.get(file).getParent().toString(); FileUtils.forceMkdir(new File(dir)); - code = licensedStr + code + "\n"; + code = LICENSED_STR + code + "\n"; FileUtils.write(new File(file + "$Adaptive.java"), code, Charset.defaultCharset()); } catch (IOException e) { - e.printStackTrace(); + throw new IllegalStateException("Failed to generated adaptive class sources", e); } }); - System.out.println(classes.size()); } - private static String licensedStr = "/*\n" + + private static final String LICENSED_STR = "/*\n" + " * Licensed to the Apache Software Foundation (ASF) under one or more\n" + " * contributor license agreements. See the NOTICE file distributed with\n" + " * this work for additional information regarding copyright ownership.\n" + diff --git a/dubbo-native/src/main/java/org/apache/dubbo/common/metrics/MetricsReporterFactory$Adaptive.java b/dubbo-native/src/main/java/org/apache/dubbo/common/metrics/MetricsReporterFactory$Adaptive.java deleted file mode 100644 index ed54214c78..0000000000 --- a/dubbo-native/src/main/java/org/apache/dubbo/common/metrics/MetricsReporterFactory$Adaptive.java +++ /dev/null @@ -1,33 +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.dubbo.common.metrics; - -import org.apache.dubbo.metrics.report.MetricsReporter; -import org.apache.dubbo.metrics.report.MetricsReporterFactory; -import org.apache.dubbo.rpc.model.ScopeModel; -import org.apache.dubbo.rpc.model.ScopeModelUtil; -public class MetricsReporterFactory$Adaptive implements MetricsReporterFactory { -public MetricsReporter createMetricsReporter(org.apache.dubbo.common.URL arg0) { -if (arg0 == null) throw new IllegalArgumentException("url == null"); -org.apache.dubbo.common.URL url = arg0; -String extName = ( url.getProtocol() == null ? "nop" : url.getProtocol() ); -if(extName == null) throw new IllegalStateException("Failed to get extension (MetricsReporterFactory) name from url (" + url.toString() + ") use keys([protocol])"); -ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), MetricsReporterFactory.class); -MetricsReporterFactory extension = (MetricsReporterFactory)scopeModel.getExtensionLoader(MetricsReporterFactory.class).getExtension(extName); -return extension.createMetricsReporter(arg0); -} -} diff --git a/dubbo-native/src/main/java/org/apache/dubbo/common/serialize/Serialization$Adaptive.java b/dubbo-native/src/main/java/org/apache/dubbo/common/serialize/Serialization$Adaptive.java deleted file mode 100644 index ae3a0b6d6a..0000000000 --- a/dubbo-native/src/main/java/org/apache/dubbo/common/serialize/Serialization$Adaptive.java +++ /dev/null @@ -1,45 +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.dubbo.common.serialize; -import org.apache.dubbo.rpc.model.ScopeModel; -import org.apache.dubbo.rpc.model.ScopeModelUtil; -public class Serialization$Adaptive implements org.apache.dubbo.common.serialize.Serialization { -public byte getContentTypeId() { -throw new UnsupportedOperationException("The method public abstract byte org.apache.dubbo.common.serialize.Serialization.getContentTypeId() of interface org.apache.dubbo.common.serialize.Serialization is not adaptive method!"); -} -public java.lang.String getContentType() { -throw new UnsupportedOperationException("The method public abstract java.lang.String org.apache.dubbo.common.serialize.Serialization.getContentType() of interface org.apache.dubbo.common.serialize.Serialization is not adaptive method!"); -} -public org.apache.dubbo.common.serialize.ObjectInput deserialize(org.apache.dubbo.common.URL arg0, java.io.InputStream arg1) throws java.io.IOException { -if (arg0 == null) throw new IllegalArgumentException("url == null"); -org.apache.dubbo.common.URL url = arg0; -String extName = url.getParameter("serialization", "adaptive"); -if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.common.serialize.Serialization) name from url (" + url.toString() + ") use keys([serialization])"); -ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.common.serialize.Serialization.class); -org.apache.dubbo.common.serialize.Serialization extension = (org.apache.dubbo.common.serialize.Serialization)scopeModel.getExtensionLoader(org.apache.dubbo.common.serialize.Serialization.class).getExtension(extName); -return extension.deserialize(arg0, arg1); -} -public org.apache.dubbo.common.serialize.ObjectOutput serialize(org.apache.dubbo.common.URL arg0, java.io.OutputStream arg1) throws java.io.IOException { -if (arg0 == null) throw new IllegalArgumentException("url == null"); -org.apache.dubbo.common.URL url = arg0; -String extName = url.getParameter("serialization", "adaptive"); -if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.common.serialize.Serialization) name from url (" + url.toString() + ") use keys([serialization])"); -ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.common.serialize.Serialization.class); -org.apache.dubbo.common.serialize.Serialization extension = (org.apache.dubbo.common.serialize.Serialization)scopeModel.getExtensionLoader(org.apache.dubbo.common.serialize.Serialization.class).getExtension(extName); -return extension.serialize(arg0, arg1); -} -} diff --git a/dubbo-native/src/main/java/org/apache/dubbo/common/threadpool/ThreadPool$Adaptive.java b/dubbo-native/src/main/java/org/apache/dubbo/common/threadpool/ThreadPool$Adaptive.java deleted file mode 100644 index 194958ed19..0000000000 --- a/dubbo-native/src/main/java/org/apache/dubbo/common/threadpool/ThreadPool$Adaptive.java +++ /dev/null @@ -1,30 +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.dubbo.common.threadpool; -import org.apache.dubbo.rpc.model.ScopeModel; -import org.apache.dubbo.rpc.model.ScopeModelUtil; -public class ThreadPool$Adaptive implements org.apache.dubbo.common.threadpool.ThreadPool { -public java.util.concurrent.Executor getExecutor(org.apache.dubbo.common.URL arg0) { -if (arg0 == null) throw new IllegalArgumentException("url == null"); -org.apache.dubbo.common.URL url = arg0; -String extName = url.getParameter("threadpool", "fixed"); -if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.common.threadpool.ThreadPool) name from url (" + url.toString() + ") use keys([threadpool])"); -ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.common.threadpool.ThreadPool.class); -org.apache.dubbo.common.threadpool.ThreadPool extension = (org.apache.dubbo.common.threadpool.ThreadPool)scopeModel.getExtensionLoader(org.apache.dubbo.common.threadpool.ThreadPool.class).getExtension(extName); -return extension.getExecutor(arg0); -} -} diff --git a/dubbo-native/src/main/java/org/apache/dubbo/metadata/report/MetadataReportFactory$Adaptive.java b/dubbo-native/src/main/java/org/apache/dubbo/metadata/report/MetadataReportFactory$Adaptive.java deleted file mode 100644 index 0816ad1ec3..0000000000 --- a/dubbo-native/src/main/java/org/apache/dubbo/metadata/report/MetadataReportFactory$Adaptive.java +++ /dev/null @@ -1,33 +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.dubbo.metadata.report; -import org.apache.dubbo.rpc.model.ScopeModel; -import org.apache.dubbo.rpc.model.ScopeModelUtil; -public class MetadataReportFactory$Adaptive implements org.apache.dubbo.metadata.report.MetadataReportFactory { -public org.apache.dubbo.metadata.report.MetadataReport getMetadataReport(org.apache.dubbo.common.URL arg0) { -if (arg0 == null) throw new IllegalArgumentException("url == null"); -org.apache.dubbo.common.URL url = arg0; -String extName = ( url.getProtocol() == null ? "redis" : url.getProtocol() ); -if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.metadata.report.MetadataReportFactory) name from url (" + url.toString() + ") use keys([protocol])"); -ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.metadata.report.MetadataReportFactory.class); -org.apache.dubbo.metadata.report.MetadataReportFactory extension = (org.apache.dubbo.metadata.report.MetadataReportFactory)scopeModel.getExtensionLoader(org.apache.dubbo.metadata.report.MetadataReportFactory.class).getExtension(extName); -return extension.getMetadataReport(arg0); -} -public void destroy() { -throw new UnsupportedOperationException("The method public default void org.apache.dubbo.metadata.report.MetadataReportFactory.destroy() of interface org.apache.dubbo.metadata.report.MetadataReportFactory is not adaptive method!"); -} -} diff --git a/dubbo-native/src/main/java/org/apache/dubbo/monitor/MonitorFactory$Adaptive.java b/dubbo-native/src/main/java/org/apache/dubbo/monitor/MonitorFactory$Adaptive.java deleted file mode 100644 index 081064d92a..0000000000 --- a/dubbo-native/src/main/java/org/apache/dubbo/monitor/MonitorFactory$Adaptive.java +++ /dev/null @@ -1,30 +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.dubbo.monitor; -import org.apache.dubbo.rpc.model.ScopeModel; -import org.apache.dubbo.rpc.model.ScopeModelUtil; -public class MonitorFactory$Adaptive implements org.apache.dubbo.monitor.MonitorFactory { -public org.apache.dubbo.monitor.Monitor getMonitor(org.apache.dubbo.common.URL arg0) { -if (arg0 == null) throw new IllegalArgumentException("url == null"); -org.apache.dubbo.common.URL url = arg0; -String extName = ( url.getProtocol() == null ? "dubbo" : url.getProtocol() ); -if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.monitor.MonitorFactory) name from url (" + url.toString() + ") use keys([protocol])"); -ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.monitor.MonitorFactory.class); -org.apache.dubbo.monitor.MonitorFactory extension = (org.apache.dubbo.monitor.MonitorFactory)scopeModel.getExtensionLoader(org.apache.dubbo.monitor.MonitorFactory.class).getExtension(extName); -return extension.getMonitor(arg0); -} -} diff --git a/dubbo-native/src/main/java/org/apache/dubbo/registry/RegistryFactory$Adaptive.java b/dubbo-native/src/main/java/org/apache/dubbo/registry/RegistryFactory$Adaptive.java deleted file mode 100644 index 8b3ebc963e..0000000000 --- a/dubbo-native/src/main/java/org/apache/dubbo/registry/RegistryFactory$Adaptive.java +++ /dev/null @@ -1,30 +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.dubbo.registry; -import org.apache.dubbo.rpc.model.ScopeModel; -import org.apache.dubbo.rpc.model.ScopeModelUtil; -public class RegistryFactory$Adaptive implements org.apache.dubbo.registry.RegistryFactory { -public org.apache.dubbo.registry.Registry getRegistry(org.apache.dubbo.common.URL arg0) { -if (arg0 == null) throw new IllegalArgumentException("url == null"); -org.apache.dubbo.common.URL url = arg0; -String extName = ( url.getProtocol() == null ? "adaptive" : url.getProtocol() ); -if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.registry.RegistryFactory) name from url (" + url.toString() + ") use keys([protocol])"); -ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.registry.RegistryFactory.class); -org.apache.dubbo.registry.RegistryFactory extension = (org.apache.dubbo.registry.RegistryFactory)scopeModel.getExtensionLoader(org.apache.dubbo.registry.RegistryFactory.class).getExtension(extName); -return extension.getRegistry(arg0); -} -} diff --git a/dubbo-native/src/main/java/org/apache/dubbo/remoting/Codec$Adaptive.java b/dubbo-native/src/main/java/org/apache/dubbo/remoting/Codec$Adaptive.java deleted file mode 100644 index 25c3b4146f..0000000000 --- a/dubbo-native/src/main/java/org/apache/dubbo/remoting/Codec$Adaptive.java +++ /dev/null @@ -1,41 +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.dubbo.remoting; -import org.apache.dubbo.rpc.model.ScopeModel; -import org.apache.dubbo.rpc.model.ScopeModelUtil; -public class Codec$Adaptive implements org.apache.dubbo.remoting.Codec { -public java.lang.Object decode(org.apache.dubbo.remoting.Channel arg0, java.io.InputStream arg1) throws java.io.IOException { -if (arg0 == null) throw new IllegalArgumentException("org.apache.dubbo.remoting.Channel argument == null"); -if (arg0.getUrl() == null) throw new IllegalArgumentException("org.apache.dubbo.remoting.Channel argument getUrl() == null"); -org.apache.dubbo.common.URL url = arg0.getUrl(); -String extName = url.getParameter("codec", "adaptive"); -if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.remoting.Codec) name from url (" + url.toString() + ") use keys([codec])"); -ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.remoting.Codec.class); -org.apache.dubbo.remoting.Codec extension = (org.apache.dubbo.remoting.Codec)scopeModel.getExtensionLoader(org.apache.dubbo.remoting.Codec.class).getExtension(extName); -return extension.decode(arg0, arg1); -} -public void encode(org.apache.dubbo.remoting.Channel arg0, java.io.OutputStream arg1, java.lang.Object arg2) throws java.io.IOException { -if (arg0 == null) throw new IllegalArgumentException("org.apache.dubbo.remoting.Channel argument == null"); -if (arg0.getUrl() == null) throw new IllegalArgumentException("org.apache.dubbo.remoting.Channel argument getUrl() == null"); -org.apache.dubbo.common.URL url = arg0.getUrl(); -String extName = url.getParameter("codec", "adaptive"); -if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.remoting.Codec) name from url (" + url.toString() + ") use keys([codec])"); -ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.remoting.Codec.class); -org.apache.dubbo.remoting.Codec extension = (org.apache.dubbo.remoting.Codec)scopeModel.getExtensionLoader(org.apache.dubbo.remoting.Codec.class).getExtension(extName); -extension.encode(arg0, arg1, arg2); -} -} diff --git a/dubbo-native/src/main/java/org/apache/dubbo/remoting/Codec2$Adaptive.java b/dubbo-native/src/main/java/org/apache/dubbo/remoting/Codec2$Adaptive.java deleted file mode 100644 index cffc978798..0000000000 --- a/dubbo-native/src/main/java/org/apache/dubbo/remoting/Codec2$Adaptive.java +++ /dev/null @@ -1,41 +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.dubbo.remoting; -import org.apache.dubbo.rpc.model.ScopeModel; -import org.apache.dubbo.rpc.model.ScopeModelUtil; -public class Codec2$Adaptive implements org.apache.dubbo.remoting.Codec2 { -public java.lang.Object decode(org.apache.dubbo.remoting.Channel arg0, org.apache.dubbo.remoting.buffer.ChannelBuffer arg1) throws java.io.IOException { -if (arg0 == null) throw new IllegalArgumentException("org.apache.dubbo.remoting.Channel argument == null"); -if (arg0.getUrl() == null) throw new IllegalArgumentException("org.apache.dubbo.remoting.Channel argument getUrl() == null"); -org.apache.dubbo.common.URL url = arg0.getUrl(); -String extName = url.getParameter("codec", "adaptive"); -if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.remoting.Codec2) name from url (" + url.toString() + ") use keys([codec])"); -ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.remoting.Codec2.class); -org.apache.dubbo.remoting.Codec2 extension = (org.apache.dubbo.remoting.Codec2)scopeModel.getExtensionLoader(org.apache.dubbo.remoting.Codec2.class).getExtension(extName); -return extension.decode(arg0, arg1); -} -public void encode(org.apache.dubbo.remoting.Channel arg0, org.apache.dubbo.remoting.buffer.ChannelBuffer arg1, java.lang.Object arg2) throws java.io.IOException { -if (arg0 == null) throw new IllegalArgumentException("org.apache.dubbo.remoting.Channel argument == null"); -if (arg0.getUrl() == null) throw new IllegalArgumentException("org.apache.dubbo.remoting.Channel argument getUrl() == null"); -org.apache.dubbo.common.URL url = arg0.getUrl(); -String extName = url.getParameter("codec", "adaptive"); -if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.remoting.Codec2) name from url (" + url.toString() + ") use keys([codec])"); -ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.remoting.Codec2.class); -org.apache.dubbo.remoting.Codec2 extension = (org.apache.dubbo.remoting.Codec2)scopeModel.getExtensionLoader(org.apache.dubbo.remoting.Codec2.class).getExtension(extName); -extension.encode(arg0, arg1, arg2); -} -} diff --git a/dubbo-native/src/main/java/org/apache/dubbo/remoting/Dispatcher$Adaptive.java b/dubbo-native/src/main/java/org/apache/dubbo/remoting/Dispatcher$Adaptive.java deleted file mode 100644 index 51269145d4..0000000000 --- a/dubbo-native/src/main/java/org/apache/dubbo/remoting/Dispatcher$Adaptive.java +++ /dev/null @@ -1,30 +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.dubbo.remoting; -import org.apache.dubbo.rpc.model.ScopeModel; -import org.apache.dubbo.rpc.model.ScopeModelUtil; -public class Dispatcher$Adaptive implements org.apache.dubbo.remoting.Dispatcher { -public org.apache.dubbo.remoting.ChannelHandler dispatch(org.apache.dubbo.remoting.ChannelHandler arg0, org.apache.dubbo.common.URL arg1) { -if (arg1 == null) throw new IllegalArgumentException("url == null"); -org.apache.dubbo.common.URL url = arg1; -String extName = url.getParameter("dispatcher", url.getParameter("dispather", url.getParameter("channel.handler", "all"))); -if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.remoting.Dispatcher) name from url (" + url.toString() + ") use keys([dispatcher, dispather, channel.handler])"); -ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.remoting.Dispatcher.class); -org.apache.dubbo.remoting.Dispatcher extension = (org.apache.dubbo.remoting.Dispatcher)scopeModel.getExtensionLoader(org.apache.dubbo.remoting.Dispatcher.class).getExtension(extName); -return extension.dispatch(arg0, arg1); -} -} diff --git a/dubbo-native/src/main/java/org/apache/dubbo/remoting/Transporter$Adaptive.java b/dubbo-native/src/main/java/org/apache/dubbo/remoting/Transporter$Adaptive.java deleted file mode 100644 index 6a858aebf4..0000000000 --- a/dubbo-native/src/main/java/org/apache/dubbo/remoting/Transporter$Adaptive.java +++ /dev/null @@ -1,39 +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.dubbo.remoting; -import org.apache.dubbo.rpc.model.ScopeModel; -import org.apache.dubbo.rpc.model.ScopeModelUtil; -public class Transporter$Adaptive implements org.apache.dubbo.remoting.Transporter { -public org.apache.dubbo.remoting.Client connect(org.apache.dubbo.common.URL arg0, org.apache.dubbo.remoting.ChannelHandler arg1) throws org.apache.dubbo.remoting.RemotingException { -if (arg0 == null) throw new IllegalArgumentException("url == null"); -org.apache.dubbo.common.URL url = arg0; -String extName = url.getParameter("client", url.getParameter("transporter", "netty")); -if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.remoting.Transporter) name from url (" + url.toString() + ") use keys([client, transporter])"); -ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.remoting.Transporter.class); -org.apache.dubbo.remoting.Transporter extension = (org.apache.dubbo.remoting.Transporter)scopeModel.getExtensionLoader(org.apache.dubbo.remoting.Transporter.class).getExtension(extName); -return extension.connect(arg0, arg1); -} -public org.apache.dubbo.remoting.RemotingServer bind(org.apache.dubbo.common.URL arg0, org.apache.dubbo.remoting.ChannelHandler arg1) throws org.apache.dubbo.remoting.RemotingException { -if (arg0 == null) throw new IllegalArgumentException("url == null"); -org.apache.dubbo.common.URL url = arg0; -String extName = url.getParameter("server", url.getParameter("transporter", "netty")); -if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.remoting.Transporter) name from url (" + url.toString() + ") use keys([server, transporter])"); -ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.remoting.Transporter.class); -org.apache.dubbo.remoting.Transporter extension = (org.apache.dubbo.remoting.Transporter)scopeModel.getExtensionLoader(org.apache.dubbo.remoting.Transporter.class).getExtension(extName); -return extension.bind(arg0, arg1); -} -} diff --git a/dubbo-native/src/main/java/org/apache/dubbo/remoting/api/pu/PortUnificationTransporter$Adaptive.java b/dubbo-native/src/main/java/org/apache/dubbo/remoting/api/pu/PortUnificationTransporter$Adaptive.java deleted file mode 100644 index d5c1cc0a7a..0000000000 --- a/dubbo-native/src/main/java/org/apache/dubbo/remoting/api/pu/PortUnificationTransporter$Adaptive.java +++ /dev/null @@ -1,39 +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.dubbo.remoting.api.pu; -import org.apache.dubbo.rpc.model.ScopeModel; -import org.apache.dubbo.rpc.model.ScopeModelUtil; -public class PortUnificationTransporter$Adaptive implements org.apache.dubbo.remoting.api.pu.PortUnificationTransporter { -public org.apache.dubbo.remoting.api.connection.AbstractConnectionClient connect(org.apache.dubbo.common.URL arg0, org.apache.dubbo.remoting.ChannelHandler arg1) throws org.apache.dubbo.remoting.RemotingException { -if (arg0 == null) throw new IllegalArgumentException("url == null"); -org.apache.dubbo.common.URL url = arg0; -String extName = url.getParameter("client", url.getParameter("transporter", "netty4")); -if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.remoting.api.pu.PortUnificationTransporter) name from url (" + url.toString() + ") use keys([client, transporter])"); -ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.remoting.api.pu.PortUnificationTransporter.class); -org.apache.dubbo.remoting.api.pu.PortUnificationTransporter extension = (org.apache.dubbo.remoting.api.pu.PortUnificationTransporter)scopeModel.getExtensionLoader(org.apache.dubbo.remoting.api.pu.PortUnificationTransporter.class).getExtension(extName); -return extension.connect(arg0, arg1); -} -public org.apache.dubbo.remoting.api.pu.AbstractPortUnificationServer bind(org.apache.dubbo.common.URL arg0, org.apache.dubbo.remoting.ChannelHandler arg1) throws org.apache.dubbo.remoting.RemotingException { -if (arg0 == null) throw new IllegalArgumentException("url == null"); -org.apache.dubbo.common.URL url = arg0; -String extName = url.getParameter("server", url.getParameter("transporter", "netty4")); -if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.remoting.api.pu.PortUnificationTransporter) name from url (" + url.toString() + ") use keys([server, transporter])"); -ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.remoting.api.pu.PortUnificationTransporter.class); -org.apache.dubbo.remoting.api.pu.PortUnificationTransporter extension = (org.apache.dubbo.remoting.api.pu.PortUnificationTransporter)scopeModel.getExtensionLoader(org.apache.dubbo.remoting.api.pu.PortUnificationTransporter.class).getExtension(extName); -return extension.bind(arg0, arg1); -} -} diff --git a/dubbo-native/src/main/java/org/apache/dubbo/remoting/exchange/Exchanger$Adaptive.java b/dubbo-native/src/main/java/org/apache/dubbo/remoting/exchange/Exchanger$Adaptive.java deleted file mode 100644 index 015bf179fa..0000000000 --- a/dubbo-native/src/main/java/org/apache/dubbo/remoting/exchange/Exchanger$Adaptive.java +++ /dev/null @@ -1,39 +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.dubbo.remoting.exchange; -import org.apache.dubbo.rpc.model.ScopeModel; -import org.apache.dubbo.rpc.model.ScopeModelUtil; -public class Exchanger$Adaptive implements org.apache.dubbo.remoting.exchange.Exchanger { -public org.apache.dubbo.remoting.exchange.ExchangeClient connect(org.apache.dubbo.common.URL arg0, org.apache.dubbo.remoting.exchange.ExchangeHandler arg1) throws org.apache.dubbo.remoting.RemotingException { -if (arg0 == null) throw new IllegalArgumentException("url == null"); -org.apache.dubbo.common.URL url = arg0; -String extName = url.getParameter("exchanger", "header"); -if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.remoting.exchange.Exchanger) name from url (" + url.toString() + ") use keys([exchanger])"); -ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.remoting.exchange.Exchanger.class); -org.apache.dubbo.remoting.exchange.Exchanger extension = (org.apache.dubbo.remoting.exchange.Exchanger)scopeModel.getExtensionLoader(org.apache.dubbo.remoting.exchange.Exchanger.class).getExtension(extName); -return extension.connect(arg0, arg1); -} -public org.apache.dubbo.remoting.exchange.ExchangeServer bind(org.apache.dubbo.common.URL arg0, org.apache.dubbo.remoting.exchange.ExchangeHandler arg1) throws org.apache.dubbo.remoting.RemotingException { -if (arg0 == null) throw new IllegalArgumentException("url == null"); -org.apache.dubbo.common.URL url = arg0; -String extName = url.getParameter("exchanger", "header"); -if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.remoting.exchange.Exchanger) name from url (" + url.toString() + ") use keys([exchanger])"); -ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.remoting.exchange.Exchanger.class); -org.apache.dubbo.remoting.exchange.Exchanger extension = (org.apache.dubbo.remoting.exchange.Exchanger)scopeModel.getExtensionLoader(org.apache.dubbo.remoting.exchange.Exchanger.class).getExtension(extName); -return extension.bind(arg0, arg1); -} -} diff --git a/dubbo-native/src/main/java/org/apache/dubbo/rpc/Protocol$Adaptive.java b/dubbo-native/src/main/java/org/apache/dubbo/rpc/Protocol$Adaptive.java deleted file mode 100644 index 16367fa414..0000000000 --- a/dubbo-native/src/main/java/org/apache/dubbo/rpc/Protocol$Adaptive.java +++ /dev/null @@ -1,49 +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.dubbo.rpc; -import org.apache.dubbo.rpc.model.ScopeModel; -import org.apache.dubbo.rpc.model.ScopeModelUtil; -public class Protocol$Adaptive implements org.apache.dubbo.rpc.Protocol { -public int getDefaultPort() { -throw new UnsupportedOperationException("The method public abstract int org.apache.dubbo.rpc.Protocol.getDefaultPort() of interface org.apache.dubbo.rpc.Protocol is not adaptive method!"); -} -public org.apache.dubbo.rpc.Exporter export(org.apache.dubbo.rpc.Invoker arg0) throws org.apache.dubbo.rpc.RpcException { -if (arg0 == null) throw new IllegalArgumentException("org.apache.dubbo.rpc.Invoker argument == null"); -if (arg0.getUrl() == null) throw new IllegalArgumentException("org.apache.dubbo.rpc.Invoker argument getUrl() == null"); -org.apache.dubbo.common.URL url = arg0.getUrl(); -String extName = ( url.getProtocol() == null ? "dubbo" : url.getProtocol() ); -if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.rpc.Protocol) name from url (" + url.toString() + ") use keys([protocol])"); -ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.rpc.Protocol.class); -org.apache.dubbo.rpc.Protocol extension = (org.apache.dubbo.rpc.Protocol)scopeModel.getExtensionLoader(org.apache.dubbo.rpc.Protocol.class).getExtension(extName); -return extension.export(arg0); -} -public org.apache.dubbo.rpc.Invoker refer(java.lang.Class arg0, org.apache.dubbo.common.URL arg1) throws org.apache.dubbo.rpc.RpcException { -if (arg1 == null) throw new IllegalArgumentException("url == null"); -org.apache.dubbo.common.URL url = arg1; -String extName = ( url.getProtocol() == null ? "dubbo" : url.getProtocol() ); -if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.rpc.Protocol) name from url (" + url.toString() + ") use keys([protocol])"); -ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.rpc.Protocol.class); -org.apache.dubbo.rpc.Protocol extension = (org.apache.dubbo.rpc.Protocol)scopeModel.getExtensionLoader(org.apache.dubbo.rpc.Protocol.class).getExtension(extName); -return extension.refer(arg0, arg1); -} -public void destroy() { -throw new UnsupportedOperationException("The method public abstract void org.apache.dubbo.rpc.Protocol.destroy() of interface org.apache.dubbo.rpc.Protocol is not adaptive method!"); -} -public java.util.List getServers() { -throw new UnsupportedOperationException("The method public default java.util.List org.apache.dubbo.rpc.Protocol.getServers() of interface org.apache.dubbo.rpc.Protocol is not adaptive method!"); -} -} diff --git a/dubbo-native/src/main/java/org/apache/dubbo/rpc/ProxyFactory$Adaptive.java b/dubbo-native/src/main/java/org/apache/dubbo/rpc/ProxyFactory$Adaptive.java deleted file mode 100644 index 101925d8ab..0000000000 --- a/dubbo-native/src/main/java/org/apache/dubbo/rpc/ProxyFactory$Adaptive.java +++ /dev/null @@ -1,50 +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.dubbo.rpc; -import org.apache.dubbo.rpc.model.ScopeModel; -import org.apache.dubbo.rpc.model.ScopeModelUtil; -public class ProxyFactory$Adaptive implements org.apache.dubbo.rpc.ProxyFactory { -public java.lang.Object getProxy(org.apache.dubbo.rpc.Invoker arg0) throws org.apache.dubbo.rpc.RpcException { -if (arg0 == null) throw new IllegalArgumentException("org.apache.dubbo.rpc.Invoker argument == null"); -if (arg0.getUrl() == null) throw new IllegalArgumentException("org.apache.dubbo.rpc.Invoker argument getUrl() == null"); -org.apache.dubbo.common.URL url = arg0.getUrl(); -String extName = url.getParameter("proxy", "javassist"); -if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.rpc.ProxyFactory) name from url (" + url.toString() + ") use keys([proxy])"); -ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.rpc.ProxyFactory.class); -org.apache.dubbo.rpc.ProxyFactory extension = (org.apache.dubbo.rpc.ProxyFactory)scopeModel.getExtensionLoader(org.apache.dubbo.rpc.ProxyFactory.class).getExtension(extName); -return extension.getProxy(arg0); -} -public java.lang.Object getProxy(org.apache.dubbo.rpc.Invoker arg0, boolean arg1) throws org.apache.dubbo.rpc.RpcException { -if (arg0 == null) throw new IllegalArgumentException("org.apache.dubbo.rpc.Invoker argument == null"); -if (arg0.getUrl() == null) throw new IllegalArgumentException("org.apache.dubbo.rpc.Invoker argument getUrl() == null"); -org.apache.dubbo.common.URL url = arg0.getUrl(); -String extName = url.getParameter("proxy", "javassist"); -if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.rpc.ProxyFactory) name from url (" + url.toString() + ") use keys([proxy])"); -ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.rpc.ProxyFactory.class); -org.apache.dubbo.rpc.ProxyFactory extension = (org.apache.dubbo.rpc.ProxyFactory)scopeModel.getExtensionLoader(org.apache.dubbo.rpc.ProxyFactory.class).getExtension(extName); -return extension.getProxy(arg0, arg1); -} -public org.apache.dubbo.rpc.Invoker getInvoker(java.lang.Object arg0, java.lang.Class arg1, org.apache.dubbo.common.URL arg2) throws org.apache.dubbo.rpc.RpcException { -if (arg2 == null) throw new IllegalArgumentException("url == null"); -org.apache.dubbo.common.URL url = arg2; -String extName = url.getParameter("proxy", "javassist"); -if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.rpc.ProxyFactory) name from url (" + url.toString() + ") use keys([proxy])"); -ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.rpc.ProxyFactory.class); -org.apache.dubbo.rpc.ProxyFactory extension = (org.apache.dubbo.rpc.ProxyFactory)scopeModel.getExtensionLoader(org.apache.dubbo.rpc.ProxyFactory.class).getExtension(extName); -return extension.getInvoker(arg0, arg1, arg2); -} -} diff --git a/dubbo-native/src/main/java/org/apache/dubbo/rpc/cluster/Cluster$Adaptive.java b/dubbo-native/src/main/java/org/apache/dubbo/rpc/cluster/Cluster$Adaptive.java deleted file mode 100644 index e8b087d611..0000000000 --- a/dubbo-native/src/main/java/org/apache/dubbo/rpc/cluster/Cluster$Adaptive.java +++ /dev/null @@ -1,37 +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.dubbo.rpc.cluster; -import org.apache.dubbo.rpc.model.ScopeModel; -import org.apache.dubbo.rpc.model.ScopeModelUtil; -public class Cluster$Adaptive implements org.apache.dubbo.rpc.cluster.Cluster { -public org.apache.dubbo.rpc.Invoker join(org.apache.dubbo.rpc.cluster.Directory arg0, boolean arg1) throws org.apache.dubbo.rpc.RpcException { -if (arg0 == null) throw new IllegalArgumentException("org.apache.dubbo.rpc.cluster.Directory argument == null"); -if (arg0.getUrl() == null) throw new IllegalArgumentException("org.apache.dubbo.rpc.cluster.Directory argument getUrl() == null"); -org.apache.dubbo.common.URL url = arg0.getUrl(); -String extName = url.getParameter("cluster", "failover"); -if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.rpc.cluster.Cluster) name from url (" + url.toString() + ") use keys([cluster])"); -ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.rpc.cluster.Cluster.class); -org.apache.dubbo.rpc.cluster.Cluster extension = (org.apache.dubbo.rpc.cluster.Cluster)scopeModel.getExtensionLoader(org.apache.dubbo.rpc.cluster.Cluster.class).getExtension(extName); -return extension.join(arg0, arg1); -} -public org.apache.dubbo.rpc.cluster.Cluster getCluster(org.apache.dubbo.rpc.model.ScopeModel arg0, java.lang.String arg1) { -throw new UnsupportedOperationException("The method public static org.apache.dubbo.rpc.cluster.Cluster org.apache.dubbo.rpc.cluster.Cluster.getCluster(org.apache.dubbo.rpc.model.ScopeModel,java.lang.String) of interface org.apache.dubbo.rpc.cluster.Cluster is not adaptive method!"); -} -public org.apache.dubbo.rpc.cluster.Cluster getCluster(org.apache.dubbo.rpc.model.ScopeModel arg0, java.lang.String arg1, boolean arg2) { -throw new UnsupportedOperationException("The method public static org.apache.dubbo.rpc.cluster.Cluster org.apache.dubbo.rpc.cluster.Cluster.getCluster(org.apache.dubbo.rpc.model.ScopeModel,java.lang.String,boolean) of interface org.apache.dubbo.rpc.cluster.Cluster is not adaptive method!"); -} -} diff --git a/dubbo-native/src/main/java/org/apache/dubbo/rpc/cluster/ConfiguratorFactory$Adaptive.java b/dubbo-native/src/main/java/org/apache/dubbo/rpc/cluster/ConfiguratorFactory$Adaptive.java deleted file mode 100644 index f4dec3f001..0000000000 --- a/dubbo-native/src/main/java/org/apache/dubbo/rpc/cluster/ConfiguratorFactory$Adaptive.java +++ /dev/null @@ -1,30 +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.dubbo.rpc.cluster; -import org.apache.dubbo.rpc.model.ScopeModel; -import org.apache.dubbo.rpc.model.ScopeModelUtil; -public class ConfiguratorFactory$Adaptive implements org.apache.dubbo.rpc.cluster.ConfiguratorFactory { -public org.apache.dubbo.rpc.cluster.Configurator getConfigurator(org.apache.dubbo.common.URL arg0) { -if (arg0 == null) throw new IllegalArgumentException("url == null"); -org.apache.dubbo.common.URL url = arg0; -String extName = ( url.getProtocol() == null ? "adaptive" : url.getProtocol() ); -if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.rpc.cluster.ConfiguratorFactory) name from url (" + url.toString() + ") use keys([protocol])"); -ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.rpc.cluster.ConfiguratorFactory.class); -org.apache.dubbo.rpc.cluster.ConfiguratorFactory extension = (org.apache.dubbo.rpc.cluster.ConfiguratorFactory)scopeModel.getExtensionLoader(org.apache.dubbo.rpc.cluster.ConfiguratorFactory.class).getExtension(extName); -return extension.getConfigurator(arg0); -} -} diff --git a/dubbo-native/src/main/java/org/apache/dubbo/rpc/cluster/LoadBalance$Adaptive.java b/dubbo-native/src/main/java/org/apache/dubbo/rpc/cluster/LoadBalance$Adaptive.java deleted file mode 100644 index f941ecd4a3..0000000000 --- a/dubbo-native/src/main/java/org/apache/dubbo/rpc/cluster/LoadBalance$Adaptive.java +++ /dev/null @@ -1,31 +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.dubbo.rpc.cluster; -import org.apache.dubbo.rpc.model.ScopeModel; -import org.apache.dubbo.rpc.model.ScopeModelUtil; -public class LoadBalance$Adaptive implements org.apache.dubbo.rpc.cluster.LoadBalance { -public org.apache.dubbo.rpc.Invoker select(java.util.List arg0, org.apache.dubbo.common.URL arg1, org.apache.dubbo.rpc.Invocation arg2) throws org.apache.dubbo.rpc.RpcException { -if (arg1 == null) throw new IllegalArgumentException("url == null"); -org.apache.dubbo.common.URL url = arg1; -if (arg2 == null) throw new IllegalArgumentException("invocation == null"); String methodName = arg2.getMethodName(); -String extName = url.getMethodParameter(methodName, "loadbalance", "random"); -if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.rpc.cluster.LoadBalance) name from url (" + url.toString() + ") use keys([loadbalance])"); -ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.rpc.cluster.LoadBalance.class); -org.apache.dubbo.rpc.cluster.LoadBalance extension = (org.apache.dubbo.rpc.cluster.LoadBalance)scopeModel.getExtensionLoader(org.apache.dubbo.rpc.cluster.LoadBalance.class).getExtension(extName); -return extension.select(arg0, arg1, arg2); -} -} diff --git a/dubbo-native/src/main/java/org/apache/dubbo/rpc/cluster/RouterFactory$Adaptive.java b/dubbo-native/src/main/java/org/apache/dubbo/rpc/cluster/RouterFactory$Adaptive.java deleted file mode 100644 index a4aa21c140..0000000000 --- a/dubbo-native/src/main/java/org/apache/dubbo/rpc/cluster/RouterFactory$Adaptive.java +++ /dev/null @@ -1,30 +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.dubbo.rpc.cluster; -import org.apache.dubbo.rpc.model.ScopeModel; -import org.apache.dubbo.rpc.model.ScopeModelUtil; -public class RouterFactory$Adaptive implements org.apache.dubbo.rpc.cluster.RouterFactory { -public org.apache.dubbo.rpc.cluster.Router getRouter(org.apache.dubbo.common.URL arg0) { -if (arg0 == null) throw new IllegalArgumentException("url == null"); -org.apache.dubbo.common.URL url = arg0; -String extName = ( url.getProtocol() == null ? "adaptive" : url.getProtocol() ); -if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.rpc.cluster.RouterFactory) name from url (" + url.toString() + ") use keys([protocol])"); -ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.rpc.cluster.RouterFactory.class); -org.apache.dubbo.rpc.cluster.RouterFactory extension = (org.apache.dubbo.rpc.cluster.RouterFactory)scopeModel.getExtensionLoader(org.apache.dubbo.rpc.cluster.RouterFactory.class).getExtension(extName); -return extension.getRouter(arg0); -} -} diff --git a/dubbo-native/src/main/java/org/apache/dubbo/rpc/cluster/router/state/StateRouterFactory$Adaptive.java b/dubbo-native/src/main/java/org/apache/dubbo/rpc/cluster/router/state/StateRouterFactory$Adaptive.java deleted file mode 100644 index c33747dc83..0000000000 --- a/dubbo-native/src/main/java/org/apache/dubbo/rpc/cluster/router/state/StateRouterFactory$Adaptive.java +++ /dev/null @@ -1,30 +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.dubbo.rpc.cluster.router.state; -import org.apache.dubbo.rpc.model.ScopeModel; -import org.apache.dubbo.rpc.model.ScopeModelUtil; -public class StateRouterFactory$Adaptive implements org.apache.dubbo.rpc.cluster.router.state.StateRouterFactory { -public org.apache.dubbo.rpc.cluster.router.state.StateRouter getRouter(java.lang.Class arg0, org.apache.dubbo.common.URL arg1) { -if (arg1 == null) throw new IllegalArgumentException("url == null"); -org.apache.dubbo.common.URL url = arg1; -String extName = ( url.getProtocol() == null ? "adaptive" : url.getProtocol() ); -if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.rpc.cluster.router.state.StateRouterFactory) name from url (" + url.toString() + ") use keys([protocol])"); -ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.rpc.cluster.router.state.StateRouterFactory.class); -org.apache.dubbo.rpc.cluster.router.state.StateRouterFactory extension = (org.apache.dubbo.rpc.cluster.router.state.StateRouterFactory)scopeModel.getExtensionLoader(org.apache.dubbo.rpc.cluster.router.state.StateRouterFactory.class).getExtension(extName); -return extension.getRouter(arg0, arg1); -} -} diff --git a/dubbo-native/src/main/java/org/apache/dubbo/rpc/executor/IsolationExecutorSupportFactory$Adaptive.java b/dubbo-native/src/main/java/org/apache/dubbo/rpc/executor/IsolationExecutorSupportFactory$Adaptive.java deleted file mode 100644 index fbf3bcf235..0000000000 --- a/dubbo-native/src/main/java/org/apache/dubbo/rpc/executor/IsolationExecutorSupportFactory$Adaptive.java +++ /dev/null @@ -1,33 +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.dubbo.rpc.executor; -import org.apache.dubbo.rpc.model.ScopeModel; -import org.apache.dubbo.rpc.model.ScopeModelUtil; -public class IsolationExecutorSupportFactory$Adaptive implements org.apache.dubbo.rpc.executor.IsolationExecutorSupportFactory { -public org.apache.dubbo.rpc.executor.ExecutorSupport createIsolationExecutorSupport(org.apache.dubbo.common.URL arg0) { -if (arg0 == null) throw new IllegalArgumentException("url == null"); -org.apache.dubbo.common.URL url = arg0; -String extName = ( url.getProtocol() == null ? "adaptive" : url.getProtocol() ); -if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.rpc.executor.IsolationExecutorSupportFactory) name from url (" + url.toString() + ") use keys([protocol])"); -ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.rpc.executor.IsolationExecutorSupportFactory.class); -org.apache.dubbo.rpc.executor.IsolationExecutorSupportFactory extension = (org.apache.dubbo.rpc.executor.IsolationExecutorSupportFactory)scopeModel.getExtensionLoader(org.apache.dubbo.rpc.executor.IsolationExecutorSupportFactory.class).getExtension(extName); -return extension.createIsolationExecutorSupport(arg0); -} -public org.apache.dubbo.rpc.executor.ExecutorSupport getIsolationExecutorSupport(org.apache.dubbo.common.URL arg0) { -throw new UnsupportedOperationException("The method public static org.apache.dubbo.rpc.executor.ExecutorSupport org.apache.dubbo.rpc.executor.IsolationExecutorSupportFactory.getIsolationExecutorSupport(org.apache.dubbo.common.URL) of interface org.apache.dubbo.rpc.executor.IsolationExecutorSupportFactory is not adaptive method!"); -} -} diff --git a/dubbo-test/dubbo-dependencies-all/pom.xml b/dubbo-test/dubbo-dependencies-all/pom.xml index 8922e63208..5e9a515d5a 100644 --- a/dubbo-test/dubbo-dependencies-all/pom.xml +++ b/dubbo-test/dubbo-dependencies-all/pom.xml @@ -184,6 +184,11 @@ dubbo-native-plugin + + org.apache.dubbo + dubbo-maven-plugin + + org.apache.dubbo diff --git a/dubbo-test/dubbo-test-modules/src/test/java/org/apache/dubbo/dependency/FileTest.java b/dubbo-test/dubbo-test-modules/src/test/java/org/apache/dubbo/dependency/FileTest.java index 4a69205f85..4f912e3001 100644 --- a/dubbo-test/dubbo-test-modules/src/test/java/org/apache/dubbo/dependency/FileTest.java +++ b/dubbo-test/dubbo-test-modules/src/test/java/org/apache/dubbo/dependency/FileTest.java @@ -57,6 +57,7 @@ class FileTest { ignoredModulesInDubboAll.add(Pattern.compile("dubbo-metadata-processor")); ignoredModulesInDubboAll.add(Pattern.compile("dubbo-native.*")); ignoredModulesInDubboAll.add(Pattern.compile("dubbo-spring-boot.*")); + ignoredModulesInDubboAll.add(Pattern.compile("dubbo-maven-plugin")); } @Test diff --git a/pom.xml b/pom.xml index 9323273df3..eea92a1f98 100644 --- a/pom.xml +++ b/pom.xml @@ -161,6 +161,7 @@ dubbo-kubernetes dubbo-xds dubbo-native-plugin + dubbo-maven-plugin @@ -318,6 +319,21 @@ ${checkstyle.skip} **/JSONWriter.java, + **/org/apache/dubbo/maven/plugin/aot/AbstractAotMojo.java, + **/org/apache/dubbo/maven/plugin/aot/AbstractDependencyFilterMojo.java, + **/org/apache/dubbo/maven/plugin/aot/CommandLineBuilder.java, + **/org/apache/dubbo/maven/plugin/aot/DependencyFilter.java, + **/org/apache/dubbo/maven/plugin/aot/Exclude.java, + **/org/apache/dubbo/maven/plugin/aot/ExcludeFilter.java, + **/org/apache/dubbo/maven/plugin/aot/FilterableDependency.java, + **/org/apache/dubbo/maven/plugin/aot/Include.java, + **/org/apache/dubbo/maven/plugin/aot/IncludeFilter.java, + **/org/apache/dubbo/maven/plugin/aot/JavaCompilerPluginConfiguration.java, + **/org/apache/dubbo/maven/plugin/aot/JavaExecutable.java, + **/org/apache/dubbo/maven/plugin/aot/JavaProcessExecutor.java, + **/org/apache/dubbo/maven/plugin/aot/MatchingGroupIdFilter.java, + **/org/apache/dubbo/maven/plugin/aot/RunArguments.java, + **/org/apache/dubbo/maven/plugin/aot/RunProcess.java, **/org/apache/dubbo/common/threadpool/serial/SerializingExecutor.java, **/org/apache/dubbo/common/threadlocal/InternalThreadLocal.java, **/org/apache/dubbo/common/threadlocal/InternalThreadLocalMap.java,