diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/constants/CommonConstants.java b/dubbo-common/src/main/java/org/apache/dubbo/common/constants/CommonConstants.java index b3e7fec8a9..d3d95d44ad 100644 --- a/dubbo-common/src/main/java/org/apache/dubbo/common/constants/CommonConstants.java +++ b/dubbo-common/src/main/java/org/apache/dubbo/common/constants/CommonConstants.java @@ -439,5 +439,11 @@ public interface CommonConstants { */ String URL_MERGE_PROCESSOR_KEY = "url-merge-processor"; + /** + * use native image to compile dubbo's identifier + */ + String NATIVE = "native"; + String SERVICE_NAME_MAPPING_KEY = "service-name-mapping"; + } diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/extension/ExtensionLoader.java b/dubbo-common/src/main/java/org/apache/dubbo/common/extension/ExtensionLoader.java index bcf7397751..14ac2d89b0 100644 --- a/dubbo-common/src/main/java/org/apache/dubbo/common/extension/ExtensionLoader.java +++ b/dubbo-common/src/main/java/org/apache/dubbo/common/extension/ExtensionLoader.java @@ -31,6 +31,7 @@ import org.apache.dubbo.common.utils.ConfigUtils; import org.apache.dubbo.common.utils.Holder; import org.apache.dubbo.common.utils.ReflectUtils; import org.apache.dubbo.common.utils.StringUtils; +import org.apache.dubbo.rpc.model.ApplicationModel; import java.io.BufferedReader; import java.io.InputStreamReader; @@ -62,6 +63,7 @@ import static java.util.ServiceLoader.load; import static java.util.stream.StreamSupport.stream; import static org.apache.dubbo.common.constants.CommonConstants.COMMA_SPLIT_PATTERN; import static org.apache.dubbo.common.constants.CommonConstants.DEFAULT_KEY; +import static org.apache.dubbo.common.constants.CommonConstants.NATIVE; import static org.apache.dubbo.common.constants.CommonConstants.REMOVE_VALUE_PREFIX; /** @@ -1099,8 +1101,16 @@ public class ExtensionLoader { } private Class createAdaptiveExtensionClass() { - String code = new AdaptiveClassCodeGenerator(type, cachedDefaultName).generate(); ClassLoader classLoader = findClassLoader(); + if (ApplicationModel.getEnvironment().getConfiguration().getBoolean(NATIVE, false)) { + try { + return classLoader.loadClass(type.getName() + "$Adaptive"); + } catch (ClassNotFoundException e) { + //ignore + e.printStackTrace(); + } + } + String code = new AdaptiveClassCodeGenerator(type, cachedDefaultName).generate(); org.apache.dubbo.common.compiler.Compiler compiler = ExtensionLoader.getExtensionLoader(org.apache.dubbo.common.compiler.Compiler.class).getAdaptiveExtension(); return compiler.compile(code, classLoader); } diff --git a/dubbo-common/src/main/java/org/apache/dubbo/config/AbstractInterfaceConfig.java b/dubbo-common/src/main/java/org/apache/dubbo/config/AbstractInterfaceConfig.java index c8dd6c1916..3bc224b590 100644 --- a/dubbo-common/src/main/java/org/apache/dubbo/config/AbstractInterfaceConfig.java +++ b/dubbo-common/src/main/java/org/apache/dubbo/config/AbstractInterfaceConfig.java @@ -18,6 +18,7 @@ package org.apache.dubbo.config; import org.apache.dubbo.common.URL; import org.apache.dubbo.common.Version; +import org.apache.dubbo.common.bytecode.Wrapper; import org.apache.dubbo.common.config.ConfigurationUtils; import org.apache.dubbo.common.config.InmemoryConfiguration; import org.apache.dubbo.common.utils.ClassUtils; @@ -46,6 +47,8 @@ import static org.apache.dubbo.common.constants.CommonConstants.REFERENCE_FILTER import static org.apache.dubbo.common.constants.CommonConstants.RELEASE_KEY; import static org.apache.dubbo.common.constants.CommonConstants.TAG_KEY; import static org.apache.dubbo.common.constants.CommonConstants.TIMESTAMP_KEY; +import static org.apache.dubbo.common.constants.CommonConstants.NATIVE; + /** * AbstractDefaultConfig @@ -216,6 +219,20 @@ public abstract class AbstractInterfaceConfig extends AbstractMethodConfig { } } + /** + * To obtain the method list in the port, use reflection when in native mode and javaassist otherwise. + * @param interfaceClass + * @return + */ + protected String[] methods(Class interfaceClass) { + boolean isNative = ApplicationModel.getEnvironment().getConfiguration().getBoolean(NATIVE, false); + if (isNative) { + return Arrays.stream(interfaceClass.getMethods()).map(it -> it.getName()).toArray(String[]::new); + } else { + return Wrapper.getWrapper(interfaceClass).getMethodNames(); + } + } + @Override protected void processExtraRefresh(String preferredPrefix, InmemoryConfiguration subPropsConfiguration) { if (StringUtils.hasText(interfaceName)) { diff --git a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ReferenceConfig.java b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ReferenceConfig.java index ee1a4483af..74ef3a5203 100644 --- a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ReferenceConfig.java +++ b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ReferenceConfig.java @@ -18,7 +18,6 @@ package org.apache.dubbo.config; import org.apache.dubbo.common.URL; import org.apache.dubbo.common.Version; -import org.apache.dubbo.common.bytecode.Wrapper; import org.apache.dubbo.common.constants.RegistryConstants; import org.apache.dubbo.common.extension.ExtensionLoader; import org.apache.dubbo.common.logger.Logger; @@ -274,7 +273,7 @@ public class ReferenceConfig extends ReferenceConfigBase { map.put(REVISION_KEY, revision); } - String[] methods = Wrapper.getWrapper(interfaceClass).getMethodNames(); + String[] methods = methods(interfaceClass); if (methods.length == 0) { logger.warn("No method found in service interface " + interfaceClass.getName()); map.put(METHODS_KEY, ANY_VALUE); diff --git a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ServiceConfig.java b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ServiceConfig.java index d5d9399944..7e3edb3620 100644 --- a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ServiceConfig.java +++ b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ServiceConfig.java @@ -19,7 +19,6 @@ package org.apache.dubbo.config; import org.apache.dubbo.common.URL; import org.apache.dubbo.common.URLBuilder; import org.apache.dubbo.common.Version; -import org.apache.dubbo.common.bytecode.Wrapper; import org.apache.dubbo.common.extension.ExtensionLoader; import org.apache.dubbo.common.logger.Logger; import org.apache.dubbo.common.logger.LoggerFactory; @@ -413,7 +412,7 @@ public class ServiceConfig extends ServiceConfigBase { map.put(REVISION_KEY, revision); } - String[] methods = Wrapper.getWrapper(interfaceClass).getMethodNames(); + String[] methods = methods(interfaceClass); if (methods.length == 0) { logger.warn("No method found in service interface " + interfaceClass.getName()); map.put(METHODS_KEY, ANY_VALUE); diff --git a/dubbo-demo/dubbo-demo-api/dubbo-demo-api-provider/src/main/java/org/apache/dubbo/demo/provider/Application.java b/dubbo-demo/dubbo-demo-api/dubbo-demo-api-provider/src/main/java/org/apache/dubbo/demo/provider/Application.java index 4803e0e245..f13bd3c055 100644 --- a/dubbo-demo/dubbo-demo-api/dubbo-demo-api-provider/src/main/java/org/apache/dubbo/demo/provider/Application.java +++ b/dubbo-demo/dubbo-demo-api/dubbo-demo-api-provider/src/main/java/org/apache/dubbo/demo/provider/Application.java @@ -45,10 +45,10 @@ public class Application { DubboBootstrap bootstrap = DubboBootstrap.getInstance(); bootstrap.application(new ApplicationConfig("dubbo-demo-api-provider")) - .registry(new RegistryConfig("zookeeper://127.0.0.1:2181")) - .service(service) - .start() - .await(); + .registry(new RegistryConfig("zookeeper://127.0.0.1:2181")) + .service(service) + .start() + .await(); } private static void startWithExport() throws InterruptedException { 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 new file mode 100644 index 0000000000..6c4c625085 --- /dev/null +++ b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer/pom.xml @@ -0,0 +1,176 @@ + + + + org.apache.dubbo + dubbo-demo-native + ${revision} + ../pom.xml + + + 4.0.0 + + dubbo-demo-native-consumer + + + + + + org.apache.dubbo + dubbo-demo-native-interface + ${project.version} + + + org.apache.dubbo + dubbo-config-api + + + org.apache.dubbo + dubbo-registry-multicast + + + org.apache.dubbo + dubbo-registry-zookeeper + + + org.apache.dubbo + dubbo-configcenter-zookeeper + + + org.apache.dubbo + dubbo-rpc-dubbo + + + org.apache.dubbo + dubbo-remoting-netty4 + + + org.apache.dubbo + dubbo-serialization-hessian2 + + + + org.apache.dubbo + dubbo-native + ${project.version} + + + + + + + + + dev + + true + + + dev + + + + + native + + native + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + 1.8 + 1.8 + true + true + UTF-8 + + + ${project.basedir}/src/main/java + + + + + + + org.graalvm.nativeimage + native-image-maven-plugin + 21.0.0.2 + + + + native-image + + package + + + + false + demo-native-consumer + 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-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.util.internal.logging.Log4JLogger + --initialize-at-run-time=io.netty.channel.unix.Socket + --initialize-at-run-time=io.netty.channel.ChannelHandlerMask + + --report-unsupported-elements-at-runtime + --allow-incomplete-classpath + --enable-url-protocols=http + -H:+ReportExceptionStackTraces + + + + + + + + + + + diff --git a/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer/src/main/java/com/apache/dubbo/demo/graalvm/consumer/Application.java b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer/src/main/java/com/apache/dubbo/demo/graalvm/consumer/Application.java new file mode 100644 index 0000000000..d09c85fda3 --- /dev/null +++ b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer/src/main/java/com/apache/dubbo/demo/graalvm/consumer/Application.java @@ -0,0 +1,76 @@ +/* + * 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 com.apache.dubbo.demo.graalvm.consumer; + +import org.apace.dubbo.graalvm.demo.DemoService; +import org.apache.dubbo.config.ApplicationConfig; +import org.apache.dubbo.config.ReferenceConfig; +import org.apache.dubbo.config.RegistryConfig; +import org.apache.dubbo.config.bootstrap.DubboBootstrap; +import org.apache.dubbo.config.utils.ReferenceConfigCache; + +import java.util.HashMap; +import java.util.Map; + +public class Application { + + public static void main(String[] args) { + System.setProperty("dubbo.application.logger", "log4j"); + if (isClassic(args)) { + runWithRefer(); + } else { + runWithBootstrap(); + } + } + + private static boolean isClassic(String[] args) { + return args.length > 0 && "classic".equalsIgnoreCase(args[0]); + } + + private static void runWithBootstrap() { + ReferenceConfig reference = new ReferenceConfig<>(); + reference.setInterface(DemoService.class); + reference.setGeneric("false"); + + DubboBootstrap bootstrap = DubboBootstrap.getInstance(); + ApplicationConfig applicationConfig = new ApplicationConfig("dubbo-demo-api-consumer"); + applicationConfig.setQosEnable(false); + applicationConfig.setCompiler("jdk"); + Map m = new HashMap<>(1); + m.put("proxy","jdk"); + applicationConfig.setParameters(m); + + bootstrap.application(applicationConfig) + .registry(new RegistryConfig("zookeeper://127.0.0.1:2181")) + .reference(reference) + .start(); + + DemoService demoService = ReferenceConfigCache.getCache().get(reference); + String message = demoService.sayHello("Native"); + System.out.println(message); + } + + private static void runWithRefer() { + ReferenceConfig reference = new ReferenceConfig<>(); + reference.setApplication(new ApplicationConfig("dubbo-demo-api-consumer")); + reference.setRegistry(new RegistryConfig("zookeeper://127.0.0.1:2181")); + reference.setInterface(DemoService.class); + DemoService service = reference.get(); + String message = service.sayHello("dubbo"); + System.out.println(message); + } +} diff --git a/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer/src/main/resources/Log4j.properties b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer/src/main/resources/Log4j.properties new file mode 100644 index 0000000000..4e90fa24e7 --- /dev/null +++ b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer/src/main/resources/Log4j.properties @@ -0,0 +1,25 @@ +# +# +# 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. +# +# + + +log4j.rootLogger=error, console + +log4j.appender.console=org.apache.log4j.ConsoleAppender +log4j.appender.console.layout=org.apache.log4j.PatternLayout +log4j.appender.console.layout.ConversionPattern=[%-12d{HH\:mm\:ss.SS}] [%p] %l %m%n diff --git a/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer/src/main/resources/META-INF/native-image/jni-config.json b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer/src/main/resources/META-INF/native-image/jni-config.json new file mode 100644 index 0000000000..0d4f101c7a --- /dev/null +++ b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer/src/main/resources/META-INF/native-image/jni-config.json @@ -0,0 +1,2 @@ +[ +] 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..572a0c8afc --- /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,3 @@ +[ + ["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-consumer/src/main/resources/META-INF/native-image/reflect-config.json b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer/src/main/resources/META-INF/native-image/reflect-config.json new file mode 100644 index 0000000000..2aeba373cf --- /dev/null +++ b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer/src/main/resources/META-INF/native-image/reflect-config.json @@ -0,0 +1,1149 @@ +[ +{ + "name":"byte[]" +}, +{ + "name":"com.intellij.rt.execution.application.AppMainV2$Agent", + "methods":[{"name":"premain","parameterTypes":["java.lang.String","java.lang.instrument.Instrumentation"] }] +}, +{ + "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.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.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.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.security.interfaces.RSAPrivateKey" +}, +{ + "name":"java.security.interfaces.RSAPublicKey" +}, +{ + "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", + "allDeclaredMethods":true +}, +{ + "name":"java.util.Date" +}, +{ + "name":"java.util.HashMap", + "allDeclaredMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"java.util.LinkedHashMap", + "allDeclaredMethods":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":"javax.security.auth.x500.X500Principal", + "fields":[{"name":"thisX500Name"}], + "methods":[{"name":"","parameterTypes":["sun.security.x509.X500Name"] }] +}, +{ + "name":"org.apace.dubbo.graalvm.demo.DemoService", + "allPublicMethods":true +}, +{ + "name":"org.apache.dubbo.common.config.Environment", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.common.config.configcenter.file.FileSystemDynamicConfigurationFactory", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.common.config.configcenter.nop.NopDynamicConfigurationFactory", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.common.extension.factory.AdaptiveExtensionFactory", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.common.extension.factory.SpiExtensionFactory", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.common.infra.support.EnvironmentAdapter", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.common.logger.jcl.JclLoggerAdapter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.common.logger.jdk.JdkLoggerAdapter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.common.logger.log4j.Log4jLoggerAdapter", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.common.logger.log4j2.Log4j2LoggerAdapter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.common.logger.slf4j.Slf4jLoggerAdapter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.common.serialize.hessian2.Hessian2Serialization", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.common.serialize.hessian2.dubbo.DefaultHessian2FactoryInitializer", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.common.serialize.hessian2.dubbo.WhitelistHessian2FactoryInitializer", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "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":[] }] +}, +{ + "name":"org.apache.dubbo.common.threadpool.support.cached.CachedThreadPool", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.common.threadpool.support.eager.EagerThreadPool", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.common.threadpool.support.fixed.FixedThreadPool", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.common.threadpool.support.limited.LimitedThreadPool", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.common.url.component.param.DefaultDynamicParamSource", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.config.AbstractConfig", + "allDeclaredFields":true, + "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 +}, +{ + "name":"org.apache.dubbo.config.ConfigCenterConfig", + "allDeclaredFields":true, + "allPublicMethods":true +}, +{ + "name":"org.apache.dubbo.config.ConsumerConfig", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.config.ModuleConfig", + "allPublicMethods":true, + "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 +}, +{ + "name":"org.apache.dubbo.config.ReferenceConfigBase", + "allPublicMethods":true +}, +{ + "name":"org.apache.dubbo.config.RegistryConfig", + "allPublicMethods":true +}, +{ + "name":"org.apache.dubbo.config.SslConfig", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.config.context.ConfigManager", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.configcenter.support.zookeeper.ZookeeperDynamicConfigurationFactory", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "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.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.MonitorClusterFilter", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.monitor.support.MonitorFilter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.monitor.support.MonitorServiceDetector", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "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.client.DefaultRegistryClusterIdentifier", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.registry.client.DefaultServiceDiscoveryFactory", + "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, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.registry.client.metadata.store.InMemoryWritableMetadataService", + "allPublicMethods":true, + "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, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.registry.integration.InterfaceCompatibleRegistryProtocol", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.registry.integration.RegistryProtocol", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.registry.multicast.MulticastRegistryFactory", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.registry.multicast.MulticastServiceDiscoveryFactory", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "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$Adaptive", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.remoting.Transporter$Adaptive", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.remoting.exchange.codec.ExchangeCodec", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.remoting.exchange.support.header.HeaderExchanger", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.remoting.telnet.codec.TelnetCodec", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.remoting.transport.codec.TransportCodec", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.remoting.transport.dispatcher.all.AllDispatcher", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.remoting.transport.dispatcher.connection.ConnectionOrderedDispatcher", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.remoting.transport.dispatcher.direct.DirectDispatcher", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.remoting.transport.dispatcher.execution.ExecutionDispatcher", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.remoting.transport.dispatcher.message.MessageOnlyDispatcher", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "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.NettyTransporter", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.remoting.zookeeper.ZookeeperTransporter$Adaptive", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.remoting.zookeeper.curator.CuratorZookeeperTransporter", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.Protocol$Adaptive", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.ProxyFactory$Adaptive", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.cluster.Cluster$Adaptive", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.cluster.ConfiguratorFactory$Adaptive", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.cluster.RouterFactory$Adaptive", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.cluster.configurator.absent.AbsentConfiguratorFactory", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.cluster.configurator.override.OverrideConfiguratorFactory", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "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, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.cluster.filter.support.ZoneAwareFilter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.cluster.governance.DefaultGovernanceRuleRepositoryImpl", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.cluster.loadbalance.ConsistentHashLoadBalance", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.cluster.loadbalance.LeastActiveLoadBalance", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.cluster.loadbalance.RandomLoadBalance", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.cluster.loadbalance.RoundRobinLoadBalance", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.cluster.loadbalance.ShortestResponseLoadBalance", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.cluster.router.condition.ConditionRouterFactory", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.cluster.router.condition.config.AppRouterFactory", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.cluster.router.condition.config.ServiceRouterFactory", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.cluster.router.file.FileRouterFactory", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.cluster.router.mesh.route.MeshRuleAddressListenerInterceptor", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.cluster.router.mesh.route.MeshRuleRouterFactory", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.cluster.router.mock.MockRouterFactory", + "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", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.cluster.support.BroadcastCluster", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.cluster.support.FailbackCluster", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.cluster.support.FailfastCluster", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.cluster.support.FailoverCluster", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.cluster.support.FailsafeCluster", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.cluster.support.ForkingCluster", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.cluster.support.MergeableCluster", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.cluster.support.registry.ZoneAwareCluster", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "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", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.filter.ClassLoaderFilter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.filter.CompatibleFilter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.filter.ContextFilter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.filter.DeprecatedFilter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.filter.EchoFilter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.filter.ExceptionFilter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.filter.ExecuteLimitFilter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.filter.GenericFilter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.filter.GenericImplFilter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.filter.TimeoutFilter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.filter.TokenFilter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.filter.TpsLimitFilter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.listener.DeprecatedInvokerListener", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.model.ServiceRepository", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":["org.apache.dubbo.rpc.Protocol"] }] +}, +{ + "name":"org.apache.dubbo.rpc.protocol.dubbo.DubboCountCodec", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol", + "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", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.protocol.injvm.InjvmProtocol", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.proxy.javassist.JavassistProxyFactory", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "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", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "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.log4j.helpers.Loader" +}, +{ + "name":"org.apache.log4j.spi.OptionHandler" +}, +{ + "name":"org.apache.zookeeper.ClientCnxnSocketNIO", + "methods":[{"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.pkcs.SignerInfo[]" +}, +{ + "name":"sun.security.provider.ConfigFile", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"sun.security.provider.SHA", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"sun.security.provider.SHA2$SHA256", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"sun.security.provider.Sun", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"sun.security.provider.X509Factory", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"sun.security.rsa.RSAKeyFactory$Legacy", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"sun.security.rsa.RSASignature$SHA256withRSA", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"sun.security.rsa.SunRsaSign", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"sun.security.util.ObjectIdentifier" +}, +{ + "name":"sun.security.x509.AuthorityInfoAccessExtension", + "methods":[{"name":"","parameterTypes":["java.lang.Boolean","java.lang.Object"] }] +}, +{ + "name":"sun.security.x509.AuthorityKeyIdentifierExtension", + "methods":[{"name":"","parameterTypes":["java.lang.Boolean","java.lang.Object"] }] +}, +{ + "name":"sun.security.x509.BasicConstraintsExtension", + "methods":[{"name":"","parameterTypes":["java.lang.Boolean","java.lang.Object"] }] +}, +{ + "name":"sun.security.x509.CRLDistributionPointsExtension", + "methods":[{"name":"","parameterTypes":["java.lang.Boolean","java.lang.Object"] }] +}, +{ + "name":"sun.security.x509.CertificateExtensions" +}, +{ + "name":"sun.security.x509.CertificatePoliciesExtension", + "methods":[{"name":"","parameterTypes":["java.lang.Boolean","java.lang.Object"] }] +}, +{ + "name":"sun.security.x509.ExtendedKeyUsageExtension", + "methods":[{"name":"","parameterTypes":["java.lang.Boolean","java.lang.Object"] }] +}, +{ + "name":"sun.security.x509.KeyUsageExtension", + "methods":[{"name":"","parameterTypes":["java.lang.Boolean","java.lang.Object"] }] +}, +{ + "name":"sun.security.x509.SubjectAlternativeNameExtension", + "methods":[{"name":"","parameterTypes":["java.lang.Boolean","java.lang.Object"] }] +}, +{ + "name":"sun.security.x509.SubjectKeyIdentifierExtension", + "methods":[{"name":"","parameterTypes":["java.lang.Boolean","java.lang.Object"] }] +} +] diff --git a/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer/src/main/resources/META-INF/native-image/resource-config.json b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer/src/main/resources/META-INF/native-image/resource-config.json new file mode 100644 index 0000000000..c42419ab1d --- /dev/null +++ b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer/src/main/resources/META-INF/native-image/resource-config.json @@ -0,0 +1,52 @@ +{ + "_comment": "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.", + "resources":{ + "includes":[ + {"pattern":"\\QMETA-INF/dubbo/internal/org.apache.dubbo.common.config.configcenter.DynamicConfigurationFactory\\E"}, + {"pattern":"\\QMETA-INF/dubbo/internal/org.apache.dubbo.common.context.FrameworkExt\\E"}, + {"pattern":"\\QMETA-INF/dubbo/internal/org.apache.dubbo.common.extension.ExtensionFactory\\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.serialize.hessian2.dubbo.Hessian2FactoryInitializer\\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.ServiceNameMapping\\E"}, + {"pattern":"\\QMETA-INF/dubbo/internal/org.apache.dubbo.metadata.WritableMetadataService\\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.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.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.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/services/org.apache.dubbo.common.extension.LoadingStrategy\\E"}, + {"pattern":"\\Qlog4j.properties\\E"}, + {"pattern":"\\Qdubbo.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":"\\Qorg/slf4j/impl/StaticLoggerBinder.class\\E"} + ]}, + "bundles":[] +} diff --git a/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer/src/main/resources/META-INF/native-image/serialization-config.json b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer/src/main/resources/META-INF/native-image/serialization-config.json new file mode 100644 index 0000000000..0d4f101c7a --- /dev/null +++ b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer/src/main/resources/META-INF/native-image/serialization-config.json @@ -0,0 +1,2 @@ +[ +] diff --git a/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer/src/main/resources/dubbo.properties b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer/src/main/resources/dubbo.properties new file mode 100644 index 0000000000..54015d0adf --- /dev/null +++ b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer/src/main/resources/dubbo.properties @@ -0,0 +1 @@ +native=true diff --git a/dubbo-demo/dubbo-demo-native/dubbo-demo-native-interface/pom.xml b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-interface/pom.xml new file mode 100644 index 0000000000..5771b9724e --- /dev/null +++ b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-interface/pom.xml @@ -0,0 +1,32 @@ + + + + org.apache.dubbo + dubbo-demo-native + ${revision} + ../pom.xml + + + 4.0.0 + + dubbo-demo-native-interface + + + diff --git a/dubbo-demo/dubbo-demo-native/dubbo-demo-native-interface/src/main/java/org/apace/dubbo/graalvm/demo/DemoService.java b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-interface/src/main/java/org/apace/dubbo/graalvm/demo/DemoService.java new file mode 100644 index 0000000000..566d270092 --- /dev/null +++ b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-interface/src/main/java/org/apace/dubbo/graalvm/demo/DemoService.java @@ -0,0 +1,23 @@ +/* + * 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.apace.dubbo.graalvm.demo; + +public interface DemoService { + + String sayHello(String name); + +} 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 new file mode 100644 index 0000000000..f5699b2ebe --- /dev/null +++ b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider/pom.xml @@ -0,0 +1,174 @@ + + + + org.apache.dubbo + dubbo-demo-native + ${revision} + ../pom.xml + + + 4.0.0 + + dubbo-demo-native-provider + + + + + org.apache.dubbo + dubbo-demo-native-interface + ${project.version} + + + org.apache.dubbo + dubbo-config-api + + + org.apache.dubbo + dubbo-registry-multicast + + + org.apache.dubbo + dubbo-registry-zookeeper + + + org.apache.dubbo + dubbo-rpc-dubbo + + + org.apache.dubbo + dubbo-remoting-netty4 + + + org.apache.dubbo + dubbo-serialization-hessian2 + + + + org.apache.dubbo + dubbo-native + ${project.version} + + + + + + + + + dev + + true + + + dev + + + + + native + + native + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + 1.8 + 1.8 + true + true + UTF-8 + + + ${project.basedir}/src/main/java + + + + + + + org.graalvm.nativeimage + native-image-maven-plugin + 21.0.0.2 + + + + native-image + + package + + + + false + demo-native-provider + org.apache.dubbo.demo.graalvm.provider.Application + + --no-fallback + + --initialize-at-build-time=org.slf4j.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-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.util.internal.logging.Log4JLogger + --initialize-at-run-time=io.netty.channel.unix.Socket + --initialize-at-run-time=io.netty.channel.ChannelHandlerMask + + --report-unsupported-elements-at-runtime + --allow-incomplete-classpath + --enable-url-protocols=http + -H:+ReportExceptionStackTraces + + + + + + + + + + + + diff --git a/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider/src/main/java/org/apache/dubbo/demo/graalvm/provider/Application.java b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider/src/main/java/org/apache/dubbo/demo/graalvm/provider/Application.java new file mode 100644 index 0000000000..763bee4378 --- /dev/null +++ b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider/src/main/java/org/apache/dubbo/demo/graalvm/provider/Application.java @@ -0,0 +1,78 @@ +/* + * 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.demo.graalvm.provider; + +import org.apache.dubbo.config.ApplicationConfig; +import org.apache.dubbo.config.RegistryConfig; +import org.apache.dubbo.config.ServiceConfig; +import org.apache.dubbo.config.bootstrap.DubboBootstrap; + +import org.apace.dubbo.graalvm.demo.DemoService; + +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.CountDownLatch; + +public class Application { + + public static void main(String[] args) throws Exception { + System.setProperty("dubbo.application.logger", "jdk"); + if (isClassic(args)) { + startWithExport(); + } else { + startWithBootstrap(); + } + System.in.read(); + } + + private static boolean isClassic(String[] args) { + return args.length > 0 && "classic".equalsIgnoreCase(args[0]); + } + + private static void startWithBootstrap() { + ServiceConfig service = new ServiceConfig<>(); + service.setInterface(DemoService.class); + service.setRef(new DemoServiceImpl()); + + DubboBootstrap bootstrap = DubboBootstrap.getInstance(); + + ApplicationConfig applicationConfig = new ApplicationConfig("dubbo-demo-api-provider"); + applicationConfig.setQosEnable(false); + applicationConfig.setCompiler("jdk"); + Map m = new HashMap<>(1); + m.put("proxy","jdk"); + applicationConfig.setParameters(m); + + bootstrap.application(applicationConfig) + .registry(new RegistryConfig("zookeeper://127.0.0.1:2181")) + .service(service) + .start() + .await(); + } + + private static void startWithExport() throws InterruptedException { + ServiceConfig service = new ServiceConfig<>(); + service.setInterface(DemoService.class); + service.setRef(new DemoServiceImpl()); + service.setApplication(new ApplicationConfig("dubbo-demo-api-provider")); + service.setRegistry(new RegistryConfig("zookeeper://127.0.0.1:2181")); + service.export(); + + System.out.println("dubbo service started"); + new CountDownLatch(1).await(); + } +} diff --git a/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider/src/main/java/org/apache/dubbo/demo/graalvm/provider/DemoServiceImpl.java b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider/src/main/java/org/apache/dubbo/demo/graalvm/provider/DemoServiceImpl.java new file mode 100644 index 0000000000..37459c525c --- /dev/null +++ b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider/src/main/java/org/apache/dubbo/demo/graalvm/provider/DemoServiceImpl.java @@ -0,0 +1,32 @@ +/* + * 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.demo.graalvm.provider; + +import org.apace.dubbo.graalvm.demo.DemoService; +import org.apache.dubbo.rpc.RpcContext; + + +public class DemoServiceImpl implements DemoService { + + @Override + public String sayHello(String name) { + System.out.println("Hello " + name + ", request from consumer: " + RpcContext.getContext().getRemoteAddress()); + return "Hello " + name ; + } + + +} diff --git a/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider/src/main/resources/META-INF/native-image/jni-config.json b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider/src/main/resources/META-INF/native-image/jni-config.json new file mode 100644 index 0000000000..0d4f101c7a --- /dev/null +++ b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider/src/main/resources/META-INF/native-image/jni-config.json @@ -0,0 +1,2 @@ +[ +] diff --git a/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider/src/main/resources/META-INF/native-image/proxy-config.json b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider/src/main/resources/META-INF/native-image/proxy-config.json new file mode 100644 index 0000000000..0d4f101c7a --- /dev/null +++ b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider/src/main/resources/META-INF/native-image/proxy-config.json @@ -0,0 +1,2 @@ +[ +] diff --git a/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider/src/main/resources/META-INF/native-image/reflect-config.json b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider/src/main/resources/META-INF/native-image/reflect-config.json new file mode 100644 index 0000000000..f78191ae12 --- /dev/null +++ b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider/src/main/resources/META-INF/native-image/reflect-config.json @@ -0,0 +1,1163 @@ +[ +{ + "name":"byte[]" +}, +{ + "name":"com.alibaba.fastjson.serializer.ASMSerializer_1_Endpoint", + "methods":[{"name":"","parameterTypes":["com.alibaba.fastjson.serializer.SerializeBeanInfo"] }] +}, +{ + "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.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.beans.Transient" +}, +{ + "name":"java.io.File", + "methods":[{"name":"","parameterTypes":["java.lang.String"] }] +}, +{ + "name":"java.io.Serializable", + "allDeclaredMethods":true +}, +{ + "name":"java.lang.AutoCloseable" +}, +{ + "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.Object[]" +}, +{ + "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":"java.lang.annotation.Repeatable", + "methods":[{"name":"value","parameterTypes":[] }] +}, +{ + "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.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.nio.file.Path" +}, +{ + "name":"java.security.MessageDigestSpi" +}, +{ + "name":"java.security.interfaces.RSAPrivateKey" +}, +{ + "name":"java.security.interfaces.RSAPublicKey" +}, +{ + "name":"java.sql.Clob" +}, +{ + "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.BitSet", + "allDeclaredFields":true +}, +{ + "name":"java.util.Date" +}, +{ + "name":"java.util.HashMap", + "allDeclaredMethods":true +}, +{ + "name":"java.util.LinkedHashMap", + "allPublicConstructors":true +}, +{ + "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.concurrent.ConcurrentNavigableMap" +}, +{ + "name":"java.util.concurrent.ConcurrentSkipListMap" +}, +{ + "name":"javax.management.ObjectName", + "methods":[{"name":"","parameterTypes":["java.lang.String"] }] +}, +{ + "name":"javax.security.auth.x500.X500Principal", + "fields":[{"name":"thisX500Name"}], + "methods":[{"name":"","parameterTypes":["sun.security.x509.X500Name"] }] +}, +{ + "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.URL", + "allDeclaredFields":true +}, +{ + "name":"org.apache.dubbo.common.compiler.support.AdaptiveCompiler", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.common.compiler.support.JavassistCompiler", + "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, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.common.config.configcenter.file.FileSystemDynamicConfigurationFactory", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.common.config.configcenter.nop.NopDynamicConfigurationFactory", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.common.extension.factory.AdaptiveExtensionFactory", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.common.extension.factory.SpiExtensionFactory", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.common.infra.support.EnvironmentAdapter", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.common.logger.jcl.JclLoggerAdapter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.common.logger.jdk.JdkLoggerAdapter", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.common.logger.log4j.Log4jLoggerAdapter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.common.logger.log4j2.Log4j2LoggerAdapter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.common.logger.slf4j.Slf4jLoggerAdapter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.common.serialize.hessian2.Hessian2Serialization", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.common.serialize.hessian2.dubbo.DefaultHessian2FactoryInitializer", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.common.serialize.hessian2.dubbo.WhitelistHessian2FactoryInitializer", + "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":[] }] +}, +{ + "name":"org.apache.dubbo.common.threadpool.support.cached.CachedThreadPool", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.common.threadpool.support.eager.EagerThreadPool", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.common.threadpool.support.fixed.FixedThreadPool", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.common.threadpool.support.limited.LimitedThreadPool", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "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", + "allDeclaredFields":true, + "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 +}, +{ + "name":"org.apache.dubbo.config.ArgumentConfig", + "allPublicMethods":true +}, +{ + "name":"org.apache.dubbo.config.ConfigCenterConfig", + "allPublicMethods":true +}, +{ + "name":"org.apache.dubbo.config.ConsumerConfig", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.config.MethodConfig", + "allPublicMethods":true +}, +{ + "name":"org.apache.dubbo.config.ModuleConfig", + "allPublicMethods":true, + "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.RegistryConfig", + "allDeclaredFields":true, + "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, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.config.context.ConfigManager", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.config.metadata.ServiceInstanceHostPortCustomizer", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "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.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.MonitorServiceDetector", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "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.client.DefaultRegistryClusterIdentifier", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.registry.client.DefaultServiceDiscoveryFactory", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.registry.client.DefaultServiceInstance$Endpoint", + "allDeclaredFields":true, + "allPublicFields":true, + "allPublicMethods":true +}, +{ + "name":"org.apache.dubbo.registry.client.ServiceDiscoveryRegistryFactory", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.registry.client.metadata.MetadataServiceNameMapping", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "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.migration.MigrationRuleListener", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "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", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.registry.multicast.MulticastServiceDiscoveryFactory", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "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$Adaptive", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.remoting.Transporter$Adaptive", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.remoting.exchange.codec.ExchangeCodec", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.remoting.exchange.support.header.HeaderExchanger", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.remoting.telnet.codec.TelnetCodec", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.remoting.transport.codec.TransportCodec", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.remoting.transport.dispatcher.all.AllDispatcher", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.remoting.transport.dispatcher.connection.ConnectionOrderedDispatcher", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.remoting.transport.dispatcher.direct.DirectDispatcher", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.remoting.transport.dispatcher.execution.ExecutionDispatcher", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.remoting.transport.dispatcher.message.MessageOnlyDispatcher", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "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.ZookeeperTransporter$Adaptive", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.remoting.zookeeper.curator.CuratorZookeeperTransporter", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.Protocol$Adaptive", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.ProxyFactory$Adaptive", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.cluster.ConfiguratorFactory$Adaptive", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.cluster.configurator.absent.AbsentConfiguratorFactory", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.cluster.configurator.override.OverrideConfiguratorFactory", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "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.governance.DefaultGovernanceRuleRepositoryImpl", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.filter.AccessLogFilter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.filter.ClassLoaderFilter", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.filter.CompatibleFilter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.filter.ContextFilter", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.filter.DeprecatedFilter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "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", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.filter.GenericFilter", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.filter.GenericImplFilter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.filter.TimeoutFilter", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.filter.TokenFilter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.filter.TpsLimitFilter", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.model.ServiceRepository", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":["org.apache.dubbo.rpc.Protocol"] }] +}, +{ + "name":"org.apache.dubbo.rpc.protocol.dubbo.DubboCountCodec", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol", + "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.injvm.InjvmProtocol", + "allPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.dubbo.rpc.proxy.javassist.JavassistProxyFactory", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "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.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", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.log4j.Category" +}, +{ + "name":"org.apache.log4j.CategoryKey" +}, +{ + "name":"org.apache.log4j.Logger" +}, +{ + "name":"org.apache.log4j.helpers.Loader" +}, +{ + "name":"org.apache.zookeeper.ClientCnxnSocketNIO", + "methods":[{"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.pkcs.SignerInfo[]" +}, +{ + "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.SHA2$SHA256", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"sun.security.provider.Sun", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"sun.security.provider.X509Factory", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"sun.security.rsa.RSAKeyFactory$Legacy", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"sun.security.rsa.RSASignature$SHA256withRSA", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"sun.security.rsa.SunRsaSign", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"sun.security.util.ObjectIdentifier" +}, +{ + "name":"sun.security.x509.AuthorityInfoAccessExtension", + "methods":[{"name":"","parameterTypes":["java.lang.Boolean","java.lang.Object"] }] +}, +{ + "name":"sun.security.x509.AuthorityKeyIdentifierExtension", + "methods":[{"name":"","parameterTypes":["java.lang.Boolean","java.lang.Object"] }] +}, +{ + "name":"sun.security.x509.BasicConstraintsExtension", + "methods":[{"name":"","parameterTypes":["java.lang.Boolean","java.lang.Object"] }] +}, +{ + "name":"sun.security.x509.CRLDistributionPointsExtension", + "methods":[{"name":"","parameterTypes":["java.lang.Boolean","java.lang.Object"] }] +}, +{ + "name":"sun.security.x509.CertificateExtensions" +}, +{ + "name":"sun.security.x509.CertificatePoliciesExtension", + "methods":[{"name":"","parameterTypes":["java.lang.Boolean","java.lang.Object"] }] +}, +{ + "name":"sun.security.x509.ExtendedKeyUsageExtension", + "methods":[{"name":"","parameterTypes":["java.lang.Boolean","java.lang.Object"] }] +}, +{ + "name":"sun.security.x509.KeyUsageExtension", + "methods":[{"name":"","parameterTypes":["java.lang.Boolean","java.lang.Object"] }] +}, +{ + "name":"sun.security.x509.SubjectAlternativeNameExtension", + "methods":[{"name":"","parameterTypes":["java.lang.Boolean","java.lang.Object"] }] +}, +{ + "name":"sun.security.x509.SubjectKeyIdentifierExtension", + "methods":[{"name":"","parameterTypes":["java.lang.Boolean","java.lang.Object"] }] +} +] diff --git a/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider/src/main/resources/META-INF/native-image/resource-config.json b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider/src/main/resources/META-INF/native-image/resource-config.json new file mode 100644 index 0000000000..7738933bab --- /dev/null +++ b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider/src/main/resources/META-INF/native-image/resource-config.json @@ -0,0 +1,45 @@ +{ + "_comment": "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.", + "resources":{ + "includes":[ + {"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.FrameworkExt\\E"}, + {"pattern":"\\QMETA-INF/dubbo/internal/org.apache.dubbo.common.extension.ExtensionFactory\\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.serialize.hessian2.dubbo.Hessian2FactoryInitializer\\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.ServiceNameMapping\\E"}, + {"pattern":"\\QMETA-INF/dubbo/internal/org.apache.dubbo.metadata.WritableMetadataService\\E"}, + {"pattern":"\\QMETA-INF/dubbo/internal/org.apache.dubbo.metadata.definition.builder.TypeBuilder\\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.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.Protocol\\E"}, + {"pattern":"\\QMETA-INF/dubbo/internal/org.apache.dubbo.rpc.ProxyFactory\\E"}, + {"pattern":"\\QMETA-INF/dubbo/internal/org.apache.dubbo.rpc.cluster.ConfiguratorFactory\\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.model.BuiltinServiceDetector\\E"}, + {"pattern":"\\QMETA-INF/services/org.apache.dubbo.common.extension.LoadingStrategy\\E"}, + {"pattern":"\\Qorg/apache/dubbo/common/Version.class\\E"}, + {"pattern":"\\Qdubbo.properties\\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":"\\Qorg/slf4j/impl/StaticLoggerBinder.class\\E"} + ]}, + "bundles":[] +} diff --git a/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider/src/main/resources/META-INF/native-image/serialization-config.json b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider/src/main/resources/META-INF/native-image/serialization-config.json new file mode 100644 index 0000000000..0d4f101c7a --- /dev/null +++ b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider/src/main/resources/META-INF/native-image/serialization-config.json @@ -0,0 +1,2 @@ +[ +] diff --git a/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider/src/main/resources/dubbo.properties b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider/src/main/resources/dubbo.properties new file mode 100644 index 0000000000..54015d0adf --- /dev/null +++ b/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider/src/main/resources/dubbo.properties @@ -0,0 +1 @@ +native=true diff --git a/dubbo-demo/dubbo-demo-native/pom.xml b/dubbo-demo/dubbo-demo-native/pom.xml new file mode 100644 index 0000000000..94fb7660dc --- /dev/null +++ b/dubbo-demo/dubbo-demo-native/pom.xml @@ -0,0 +1,38 @@ + + + + org.apache.dubbo + dubbo-demo + ${revision} + ../pom.xml + + + 4.0.0 + + dubbo-demo-native + pom + + dubbo-demo-native-consumer + dubbo-demo-native-provider + dubbo-demo-native-interface + + + + diff --git a/dubbo-demo/pom.xml b/dubbo-demo/pom.xml index 12dfeb3a13..8bad6df6de 100644 --- a/dubbo-demo/pom.xml +++ b/dubbo-demo/pom.xml @@ -37,6 +37,7 @@ dubbo-demo-api dubbo-demo-generic-call dubbo-demo-triple + dubbo-demo-native diff --git a/dubbo-native/pom.xml b/dubbo-native/pom.xml new file mode 100644 index 0000000000..fc70304c80 --- /dev/null +++ b/dubbo-native/pom.xml @@ -0,0 +1,70 @@ + + + + org.apache.dubbo + dubbo-parent + ${revision} + ../pom.xml + + 4.0.0 + + dubbo-native + jar + + + + + + 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} + + + + + + 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 new file mode 100644 index 0000000000..19ec0f5aa9 --- /dev/null +++ b/dubbo-native/src/main/java/org/apache/dubbo/common/serialize/Serialization$Adaptive.java @@ -0,0 +1,42 @@ +/* + * 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.common.extension.ExtensionLoader; +public class Serialization$Adaptive implements org.apache.dubbo.common.serialize.Serialization { +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", "hessian2"); +if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.common.serialize.Serialization) name from url (" + url.toString() + ") use keys([serialization])"); +org.apache.dubbo.common.serialize.Serialization extension = (org.apache.dubbo.common.serialize.Serialization)ExtensionLoader.getExtensionLoader(org.apache.dubbo.common.serialize.Serialization.class).getExtension(extName); +return extension.serialize(arg0, arg1); +} +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", "hessian2"); +if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.common.serialize.Serialization) name from url (" + url.toString() + ") use keys([serialization])"); +org.apache.dubbo.common.serialize.Serialization extension = (org.apache.dubbo.common.serialize.Serialization)ExtensionLoader.getExtensionLoader(org.apache.dubbo.common.serialize.Serialization.class).getExtension(extName); +return extension.deserialize(arg0, arg1); +} +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!"); +} +} 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 new file mode 100644 index 0000000000..575eba8bf7 --- /dev/null +++ b/dubbo-native/src/main/java/org/apache/dubbo/common/threadpool/ThreadPool$Adaptive.java @@ -0,0 +1,28 @@ +/* + * 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.common.extension.ExtensionLoader; +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])"); +org.apache.dubbo.common.threadpool.ThreadPool extension = (org.apache.dubbo.common.threadpool.ThreadPool)ExtensionLoader.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 new file mode 100644 index 0000000000..58f87da3a3 --- /dev/null +++ b/dubbo-native/src/main/java/org/apache/dubbo/metadata/report/MetadataReportFactory$Adaptive.java @@ -0,0 +1,28 @@ +/* + * 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.common.extension.ExtensionLoader; +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])"); +org.apache.dubbo.metadata.report.MetadataReportFactory extension = (org.apache.dubbo.metadata.report.MetadataReportFactory)ExtensionLoader.getExtensionLoader(org.apache.dubbo.metadata.report.MetadataReportFactory.class).getExtension(extName); +return extension.getMetadataReport(arg0); +} +} 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 new file mode 100644 index 0000000000..404d8523b8 --- /dev/null +++ b/dubbo-native/src/main/java/org/apache/dubbo/monitor/MonitorFactory$Adaptive.java @@ -0,0 +1,28 @@ +/* + * 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.common.extension.ExtensionLoader; +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])"); +org.apache.dubbo.monitor.MonitorFactory extension = (org.apache.dubbo.monitor.MonitorFactory)ExtensionLoader.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 new file mode 100644 index 0000000000..afb24d6aa3 --- /dev/null +++ b/dubbo-native/src/main/java/org/apache/dubbo/registry/RegistryFactory$Adaptive.java @@ -0,0 +1,28 @@ +/* + * 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.common.extension.ExtensionLoader; +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 ? "dubbo" : 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])"); +org.apache.dubbo.registry.RegistryFactory extension = (org.apache.dubbo.registry.RegistryFactory)ExtensionLoader.getExtensionLoader(org.apache.dubbo.registry.RegistryFactory.class).getExtension(extName); +return extension.getRegistry(arg0); +} +} diff --git a/dubbo-native/src/main/java/org/apache/dubbo/registry/client/selector/ServiceInstanceSelector$Adaptive.java b/dubbo-native/src/main/java/org/apache/dubbo/registry/client/selector/ServiceInstanceSelector$Adaptive.java new file mode 100644 index 0000000000..64a531174e --- /dev/null +++ b/dubbo-native/src/main/java/org/apache/dubbo/registry/client/selector/ServiceInstanceSelector$Adaptive.java @@ -0,0 +1,28 @@ +/* + * 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.client.selector; +import org.apache.dubbo.common.extension.ExtensionLoader; +public class ServiceInstanceSelector$Adaptive implements org.apache.dubbo.registry.client.selector.ServiceInstanceSelector { +public org.apache.dubbo.registry.client.ServiceInstance select(org.apache.dubbo.common.URL arg0, java.util.List arg1) { +if (arg0 == null) throw new IllegalArgumentException("url == null"); +org.apache.dubbo.common.URL url = arg0; +String extName = url.getParameter("service-instance-selector", "random"); +if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.registry.client.selector.ServiceInstanceSelector) name from url (" + url.toString() + ") use keys([service-instance-selector])"); +org.apache.dubbo.registry.client.selector.ServiceInstanceSelector extension = (org.apache.dubbo.registry.client.selector.ServiceInstanceSelector)ExtensionLoader.getExtensionLoader(org.apache.dubbo.registry.client.selector.ServiceInstanceSelector.class).getExtension(extName); +return extension.select(arg0, arg1); +} +} 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 new file mode 100644 index 0000000000..b565a0398a --- /dev/null +++ b/dubbo-native/src/main/java/org/apache/dubbo/remoting/Codec$Adaptive.java @@ -0,0 +1,38 @@ +/* + * 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.common.extension.ExtensionLoader; +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])"); +org.apache.dubbo.remoting.Codec extension = (org.apache.dubbo.remoting.Codec)ExtensionLoader.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])"); +org.apache.dubbo.remoting.Codec extension = (org.apache.dubbo.remoting.Codec)ExtensionLoader.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 new file mode 100644 index 0000000000..72cd838ca4 --- /dev/null +++ b/dubbo-native/src/main/java/org/apache/dubbo/remoting/Codec2$Adaptive.java @@ -0,0 +1,38 @@ +/* + * 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.common.extension.ExtensionLoader; +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])"); +org.apache.dubbo.remoting.Codec2 extension = (org.apache.dubbo.remoting.Codec2)ExtensionLoader.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])"); +org.apache.dubbo.remoting.Codec2 extension = (org.apache.dubbo.remoting.Codec2)ExtensionLoader.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 new file mode 100644 index 0000000000..02991ad076 --- /dev/null +++ b/dubbo-native/src/main/java/org/apache/dubbo/remoting/Dispatcher$Adaptive.java @@ -0,0 +1,28 @@ +/* + * 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.common.extension.ExtensionLoader; +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])"); +org.apache.dubbo.remoting.Dispatcher extension = (org.apache.dubbo.remoting.Dispatcher)ExtensionLoader.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 new file mode 100644 index 0000000000..5feec540e3 --- /dev/null +++ b/dubbo-native/src/main/java/org/apache/dubbo/remoting/Transporter$Adaptive.java @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.dubbo.remoting; +import org.apache.dubbo.common.extension.ExtensionLoader; +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])"); +org.apache.dubbo.remoting.Transporter extension = (org.apache.dubbo.remoting.Transporter)ExtensionLoader.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])"); +org.apache.dubbo.remoting.Transporter extension = (org.apache.dubbo.remoting.Transporter)ExtensionLoader.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/exchange/Exchanger$Adaptive.java b/dubbo-native/src/main/java/org/apache/dubbo/remoting/exchange/Exchanger$Adaptive.java new file mode 100644 index 0000000000..ac72686fac --- /dev/null +++ b/dubbo-native/src/main/java/org/apache/dubbo/remoting/exchange/Exchanger$Adaptive.java @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.dubbo.remoting.exchange; +import org.apache.dubbo.common.extension.ExtensionLoader; +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])"); +org.apache.dubbo.remoting.exchange.Exchanger extension = (org.apache.dubbo.remoting.exchange.Exchanger)ExtensionLoader.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])"); +org.apache.dubbo.remoting.exchange.Exchanger extension = (org.apache.dubbo.remoting.exchange.Exchanger)ExtensionLoader.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/remoting/zookeeper/ZookeeperTransporter$Adaptive.java b/dubbo-native/src/main/java/org/apache/dubbo/remoting/zookeeper/ZookeeperTransporter$Adaptive.java new file mode 100644 index 0000000000..aeed40713d --- /dev/null +++ b/dubbo-native/src/main/java/org/apache/dubbo/remoting/zookeeper/ZookeeperTransporter$Adaptive.java @@ -0,0 +1,28 @@ +/* + * 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.zookeeper; +import org.apache.dubbo.common.extension.ExtensionLoader; +public class ZookeeperTransporter$Adaptive implements org.apache.dubbo.remoting.zookeeper.ZookeeperTransporter { +public org.apache.dubbo.remoting.zookeeper.ZookeeperClient connect(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("client", url.getParameter("transporter", "curator")); +if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.remoting.zookeeper.ZookeeperTransporter) name from url (" + url.toString() + ") use keys([client, transporter])"); +org.apache.dubbo.remoting.zookeeper.ZookeeperTransporter extension = (org.apache.dubbo.remoting.zookeeper.ZookeeperTransporter)ExtensionLoader.getExtensionLoader(org.apache.dubbo.remoting.zookeeper.ZookeeperTransporter.class).getExtension(extName); +return extension.connect(arg0); +} +} 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 new file mode 100644 index 0000000000..29508bdade --- /dev/null +++ b/dubbo-native/src/main/java/org/apache/dubbo/rpc/Protocol$Adaptive.java @@ -0,0 +1,46 @@ +/* + * 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.common.extension.ExtensionLoader; +public class Protocol$Adaptive implements org.apache.dubbo.rpc.Protocol { +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])"); +org.apache.dubbo.rpc.Protocol extension = (org.apache.dubbo.rpc.Protocol)ExtensionLoader.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])"); +org.apache.dubbo.rpc.Protocol extension = (org.apache.dubbo.rpc.Protocol)ExtensionLoader.getExtensionLoader(org.apache.dubbo.rpc.Protocol.class).getExtension(extName); +return extension.refer(arg0, arg1); +} +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!"); +} +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 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!"); +} +} 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 new file mode 100644 index 0000000000..d8ba9738a8 --- /dev/null +++ b/dubbo-native/src/main/java/org/apache/dubbo/rpc/ProxyFactory$Adaptive.java @@ -0,0 +1,46 @@ +/* + * 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.common.extension.ExtensionLoader; +public class ProxyFactory$Adaptive implements org.apache.dubbo.rpc.ProxyFactory { +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])"); +org.apache.dubbo.rpc.ProxyFactory extension = (org.apache.dubbo.rpc.ProxyFactory)ExtensionLoader.getExtensionLoader(org.apache.dubbo.rpc.ProxyFactory.class).getExtension(extName); +return extension.getInvoker(arg0, arg1, arg2); +} +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])"); +org.apache.dubbo.rpc.ProxyFactory extension = (org.apache.dubbo.rpc.ProxyFactory)ExtensionLoader.getExtensionLoader(org.apache.dubbo.rpc.ProxyFactory.class).getExtension(extName); +return extension.getProxy(arg0, arg1); +} +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])"); +org.apache.dubbo.rpc.ProxyFactory extension = (org.apache.dubbo.rpc.ProxyFactory)ExtensionLoader.getExtensionLoader(org.apache.dubbo.rpc.ProxyFactory.class).getExtension(extName); +return extension.getProxy(arg0); +} +} 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 new file mode 100644 index 0000000000..ecde1f4b1f --- /dev/null +++ b/dubbo-native/src/main/java/org/apache/dubbo/rpc/cluster/Cluster$Adaptive.java @@ -0,0 +1,35 @@ +/* + * 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.common.extension.ExtensionLoader; +public class Cluster$Adaptive implements org.apache.dubbo.rpc.cluster.Cluster { +public org.apache.dubbo.rpc.cluster.Cluster getCluster(java.lang.String arg0) { +throw new UnsupportedOperationException("The method public static org.apache.dubbo.rpc.cluster.Cluster org.apache.dubbo.rpc.cluster.Cluster.getCluster(java.lang.String) of interface org.apache.dubbo.rpc.cluster.Cluster is not adaptive method!"); +} +public org.apache.dubbo.rpc.cluster.Cluster getCluster(java.lang.String arg0, boolean arg1) { +throw new UnsupportedOperationException("The method public static org.apache.dubbo.rpc.cluster.Cluster org.apache.dubbo.rpc.cluster.Cluster.getCluster(java.lang.String,boolean) of interface org.apache.dubbo.rpc.cluster.Cluster is not adaptive method!"); +} +public org.apache.dubbo.rpc.Invoker join(org.apache.dubbo.rpc.cluster.Directory arg0) 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])"); +org.apache.dubbo.rpc.cluster.Cluster extension = (org.apache.dubbo.rpc.cluster.Cluster)ExtensionLoader.getExtensionLoader(org.apache.dubbo.rpc.cluster.Cluster.class).getExtension(extName); +return extension.join(arg0); +} +} 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 new file mode 100644 index 0000000000..a0fe954ae3 --- /dev/null +++ b/dubbo-native/src/main/java/org/apache/dubbo/rpc/cluster/ConfiguratorFactory$Adaptive.java @@ -0,0 +1,28 @@ +/* + * 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.common.extension.ExtensionLoader; +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])"); +org.apache.dubbo.rpc.cluster.ConfiguratorFactory extension = (org.apache.dubbo.rpc.cluster.ConfiguratorFactory)ExtensionLoader.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 new file mode 100644 index 0000000000..cea94a8e2f --- /dev/null +++ b/dubbo-native/src/main/java/org/apache/dubbo/rpc/cluster/LoadBalance$Adaptive.java @@ -0,0 +1,29 @@ +/* + * 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.common.extension.ExtensionLoader; +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])"); +org.apache.dubbo.rpc.cluster.LoadBalance extension = (org.apache.dubbo.rpc.cluster.LoadBalance)ExtensionLoader.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 new file mode 100644 index 0000000000..fc2bf1f614 --- /dev/null +++ b/dubbo-native/src/main/java/org/apache/dubbo/rpc/cluster/RouterFactory$Adaptive.java @@ -0,0 +1,28 @@ +/* + * 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.common.extension.ExtensionLoader; +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])"); +org.apache.dubbo.rpc.cluster.RouterFactory extension = (org.apache.dubbo.rpc.cluster.RouterFactory)ExtensionLoader.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 new file mode 100644 index 0000000000..7f959a9600 --- /dev/null +++ b/dubbo-native/src/main/java/org/apache/dubbo/rpc/cluster/router/state/StateRouterFactory$Adaptive.java @@ -0,0 +1,28 @@ +/* + * 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.common.extension.ExtensionLoader; +public class StateRouterFactory$Adaptive implements org.apache.dubbo.rpc.cluster.router.state.StateRouterFactory { +public org.apache.dubbo.rpc.cluster.router.state.StateRouter getRouter(org.apache.dubbo.common.URL arg0, org.apache.dubbo.rpc.cluster.RouterChain arg1) { +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.router.state.StateRouterFactory) name from url (" + url.toString() + ") use keys([protocol])"); +org.apache.dubbo.rpc.cluster.router.state.StateRouterFactory extension = (org.apache.dubbo.rpc.cluster.router.state.StateRouterFactory)ExtensionLoader.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/utils/ClassFinder.java b/dubbo-native/src/main/java/org/apache/dubbo/utils/ClassFinder.java new file mode 100644 index 0000000000..c78d108be8 --- /dev/null +++ b/dubbo-native/src/main/java/org/apache/dubbo/utils/ClassFinder.java @@ -0,0 +1,90 @@ +/* + * 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.utils; + + +import java.io.File; +import java.net.JarURLConnection; +import java.net.URL; +import java.util.Enumeration; +import java.util.HashSet; +import java.util.Set; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; + +public class ClassFinder { + + public Set findClassSet(String packageName) { + packageName = packageName.replace(".", "/"); + try { + ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); + Enumeration resources = classLoader.getResources(packageName); + Set result = new HashSet<>(); + while (resources.hasMoreElements()) { + URL resource = (URL) resources.nextElement(); + if (resource != null) { + String protocol = resource.getProtocol(); + if ("file".equals(protocol)) { + findClassesByFile(packageName, resource.getPath(), result); + } else if ("jar".equals(protocol)) { + JarFile jar = ((JarURLConnection) resource.openConnection()).getJarFile(); + System.out.println("findClassSet jar:"+jar.getName()); + findClassesByJar(packageName, jar, result); + } + } + } + return result; + } catch (Throwable ex) { + throw new RuntimeException(ex); + } + } + + private void findClassesByFile(String packageName, String resource, Set result) { + File directory = new File(resource); + File[] listFiles = directory.listFiles(); + for (File file : listFiles) { + if (file.isDirectory()) { + findClassesByFile(packageName, file.getPath(), result); + } else { + String path = file.getPath(); + if (path.endsWith(".class")) { + int packageIndex = path.indexOf(packageName.replace("/", File.separator)); + String classPath = path.substring(packageIndex, path.length() - 6); + result.add(classPath.replace(File.separator, ".")); + } + } + } + } + + private static void findClassesByJar(String packageName, JarFile jar, Set classes) { + Enumeration entry = jar.entries(); + JarEntry jarEntry; + String name; + while (entry.hasMoreElements()) { + jarEntry = entry.nextElement(); + name = jarEntry.getName(); + if (name.charAt(0) == '/') { + name = name.substring(1); + } + if (jarEntry.isDirectory() || !name.startsWith(packageName) || !name.endsWith(".class")) { + continue; + } + String className = name.substring(0, name.length() - 6); + classes.add(className.replace("/", ".")); + } + } +} diff --git a/dubbo-native/src/main/java/org/apache/dubbo/utils/CodeGenerator.java b/dubbo-native/src/main/java/org/apache/dubbo/utils/CodeGenerator.java new file mode 100644 index 0000000000..a632d4aeba --- /dev/null +++ b/dubbo-native/src/main/java/org/apache/dubbo/utils/CodeGenerator.java @@ -0,0 +1,106 @@ +/* + * 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.utils; + +import org.apache.commons.io.FileUtils; + +import org.apache.dubbo.common.extension.Adaptive; +import org.apache.dubbo.common.extension.AdaptiveClassCodeGenerator; +import org.apache.dubbo.common.extension.SPI; +import org.apache.dubbo.common.utils.StringUtils; + +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.file.Paths; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + +/** + * generate related self-adaptive code (native image does not support dynamic code generation. Therefore, code needs to be generated before compilation) + */ +public class CodeGenerator { + + public static void main(String[] args) { + URL r = Thread.currentThread().getContextClassLoader().getResource(""); + String p = Paths.get(r.getFile()).getParent().getParent().toString() + File.separator + "src" + File.separator + "main" + File.separator + "java"; + System.out.println(p); + + List> classes = new ClassFinder().findClassSet("org.apache.dubbo").stream().map(it -> { + try { + return Class.forName(it); + } catch (Throwable e) { + } + return null; + }).collect(Collectors.toList()); + new ArrayList<>(classes).stream().filter(it -> { + if (null == it) { + return false; + } + Annotation anno = it.getAnnotation(SPI.class); + if (null == anno) { + return false; + } + Optional optional = Arrays.stream(it.getMethods()).filter(it2 -> it2.getAnnotation(Adaptive.class) != null).findAny(); + return optional.isPresent(); + }).forEach(it -> { + SPI spi = it.getAnnotation(SPI.class); + String value = spi.value(); + if (StringUtils.isEmpty(value)) { + value = "adaptive"; + } + AdaptiveClassCodeGenerator codeGenerator = new AdaptiveClassCodeGenerator(it, value); + String code = codeGenerator.generate(); + System.out.println(code); + System.out.println("-----:" + it.getPackage()); + try { + String file = p + File.separator + it.getName().replaceAll("\\.", File.separator); + String dir = Paths.get(file).getParent().toString(); + FileUtils.forceMkdir(new File(dir)); + code = licensedStr + code + "\n"; + FileUtils.write(new File(file + "$Adaptive.java"), code); + } catch (IOException e) { + e.printStackTrace(); + } + }); + System.out.println(classes.size()); + } + + + private static String licensedStr = "/*\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" + + " * The ASF licenses this file to You under the Apache License, Version 2.0\n" + + " * (the \"License\"); you may not use this file except in compliance with\n" + + " * the License. You may obtain a copy of the License at\n" + + " *\n" + + " * http://www.apache.org/licenses/LICENSE-2.0\n" + + " *\n" + + " * Unless required by applicable law or agreed to in writing, software\n" + + " * distributed under the License is distributed on an \"AS IS\" BASIS,\n" + + " * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" + + " * See the License for the specific language governing permissions and\n" + + " * limitations under the License.\n" + + " */\n"; + +} diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/metadata/MetadataServiceNameMapping.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/metadata/MetadataServiceNameMapping.java index 787d5aa7bc..38cef116e2 100644 --- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/metadata/MetadataServiceNameMapping.java +++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/metadata/MetadataServiceNameMapping.java @@ -20,6 +20,7 @@ import org.apache.dubbo.common.URL; import org.apache.dubbo.common.config.configcenter.ConfigItem; import org.apache.dubbo.common.logger.Logger; import org.apache.dubbo.common.logger.LoggerFactory; +import org.apache.dubbo.common.utils.CollectionUtils; import org.apache.dubbo.common.utils.StringUtils; import org.apache.dubbo.metadata.AbstractServiceNameMapping; import org.apache.dubbo.metadata.MappingListener; @@ -27,6 +28,7 @@ import org.apache.dubbo.metadata.MetadataService; import org.apache.dubbo.metadata.report.MetadataReport; import org.apache.dubbo.metadata.report.MetadataReportInstance; import org.apache.dubbo.registry.client.RegistryClusterIdentifier; +import org.apache.dubbo.rpc.model.ApplicationModel; import java.util.Collections; import java.util.LinkedHashSet; @@ -48,6 +50,9 @@ public class MetadataServiceNameMapping extends AbstractServiceNameMapping { @Override public void map(URL url) { execute(() -> { + if (CollectionUtils.isEmpty(ApplicationModel.getConfigManager().getMetadataConfigs())) { + return; + } String serviceInterface = url.getServiceInterface(); if (IGNORED_SERVICE_INTERFACES.contains(serviceInterface)) { return; diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/metadata/ServiceInstanceMetadataUtils.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/metadata/ServiceInstanceMetadataUtils.java index 5a183d74b1..c8d70fd27e 100644 --- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/metadata/ServiceInstanceMetadataUtils.java +++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/metadata/ServiceInstanceMetadataUtils.java @@ -16,6 +16,7 @@ */ package org.apache.dubbo.registry.client.metadata; +import com.google.gson.Gson; import org.apache.dubbo.common.URL; import org.apache.dubbo.common.extension.ExtensionLoader; import org.apache.dubbo.common.logger.Logger; @@ -34,7 +35,6 @@ import org.apache.dubbo.registry.client.metadata.store.RemoteMetadataServiceImpl import org.apache.dubbo.registry.support.AbstractRegistryFactory; import org.apache.dubbo.rpc.model.ApplicationModel; -import com.alibaba.fastjson.JSON; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -108,7 +108,7 @@ public class ServiceInstanceMetadataUtils { public static Map getMetadataServiceURLsParams(ServiceInstance serviceInstance) { Map metadata = serviceInstance.getMetadata(); String param = metadata.get(METADATA_SERVICE_URL_PARAMS_PROPERTY_NAME); - return isBlank(param) ? emptyMap() : (Map) JSON.parse(param); + return isBlank(param) ? emptyMap() : (Map) new Gson().fromJson(param,Map.class); } public static String getMetadataServiceParameter(URL url) { @@ -122,7 +122,7 @@ public class ServiceInstanceMetadataUtils { return null; } - return JSON.toJSONString(params); + return new Gson().toJson(params); } private static Map getParams(URL providerURL) { @@ -205,7 +205,7 @@ public class ServiceInstanceMetadataUtils { endpoints.add(endpoint); }); - metadata.put(ENDPOINTS, JSON.toJSONString(endpoints)); + metadata.put(ENDPOINTS, new Gson().toJson(endpoints)); } /** diff --git a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/proxy/AbstractProxyFactory.java b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/proxy/AbstractProxyFactory.java index 695ca02412..b5ab33bcba 100644 --- a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/proxy/AbstractProxyFactory.java +++ b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/proxy/AbstractProxyFactory.java @@ -26,8 +26,7 @@ import org.apache.dubbo.rpc.service.EchoService; import org.apache.dubbo.rpc.service.GenericService; import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; +import java.util.LinkedHashSet; import static org.apache.dubbo.common.constants.CommonConstants.COMMA_SPLIT_PATTERN; import static org.apache.dubbo.rpc.Constants.INTERFACES; @@ -47,7 +46,8 @@ public abstract class AbstractProxyFactory implements ProxyFactory { @Override public T getProxy(Invoker invoker, boolean generic) throws RpcException { - Set> interfaces = new HashSet<>(); + // when compiling with native image, ensure that the order of the interfaces remains unchanged + LinkedHashSet> interfaces = new LinkedHashSet<>(); String config = invoker.getUrl().getParameter(INTERFACES); if (config != null && config.length() > 0) { diff --git a/pom.xml b/pom.xml index 395cce079e..a0ed38e61a 100644 --- a/pom.xml +++ b/pom.xml @@ -152,6 +152,7 @@ dubbo-metadata dubbo-build-tools dubbo-spring-boot + dubbo-native @@ -318,6 +319,7 @@ **/istio/v1/auth/IstioCertificateServiceGrpc.java, **/generated/**/*, **/target/**/*, + **/*.json