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

crazyhzm pushed a commit to branch 3.3
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/3.3 by this push:
     new c96a06eba1 add tri native image support (#12536)
c96a06eba1 is described below

commit c96a06eba1b27300bef7a1900131b119f9b58c7c
Author: foghost <[email protected]>
AuthorDate: Mon Jun 19 11:26:50 2023 +0800

    add tri native image support (#12536)
    
    Co-authored-by: huazhongming <[email protected]>
---
 .../Netty4ReflectionTypeDescriberRegistrar.java    | 22 +++++++++++-----
 dubbo-rpc/dubbo-rpc-triple/pom.xml                 |  5 ++++
 .../TripleReflectionTypeDescriberRegistrar.java    | 30 ++++++++++++----------
 ....dubbo.aot.api.ReflectionTypeDescriberRegistrar |  1 +
 4 files changed, 37 insertions(+), 21 deletions(-)

diff --git 
a/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/aot/Netty4ReflectionTypeDescriberRegistrar.java
 
b/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/aot/Netty4ReflectionTypeDescriberRegistrar.java
index 051d590c2d..829a23a8e0 100644
--- 
a/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/aot/Netty4ReflectionTypeDescriberRegistrar.java
+++ 
b/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/aot/Netty4ReflectionTypeDescriberRegistrar.java
@@ -19,11 +19,15 @@ package org.apache.dubbo.remoting.transport.netty4.aot;
 import org.apache.dubbo.aot.api.MemberCategory;
 import org.apache.dubbo.aot.api.ReflectionTypeDescriberRegistrar;
 import org.apache.dubbo.aot.api.TypeDescriber;
+import org.apache.dubbo.remoting.transport.netty4.NettyChannelHandler;
 import org.apache.dubbo.remoting.transport.netty4.NettyClientHandler;
+import org.apache.dubbo.remoting.transport.netty4.NettyConnectionHandler;
+import 
org.apache.dubbo.remoting.transport.netty4.NettyPortUnificationServerHandler;
 import org.apache.dubbo.remoting.transport.netty4.NettyServerHandler;
 import org.apache.dubbo.remoting.transport.netty4.ssl.SslClientTlsHandler;
 import org.apache.dubbo.remoting.transport.netty4.ssl.SslServerTlsHandler;
 
+import java.nio.channels.spi.SelectorProvider;
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.List;
@@ -35,16 +39,20 @@ public class Netty4ReflectionTypeDescriberRegistrar 
implements ReflectionTypeDes
     @Override
     public List<TypeDescriber> getTypeDescribers() {
         List<TypeDescriber> typeDescribers = new ArrayList<>();
-        
typeDescribers.add(buildTypeDescriberWithDeclaredMethods(NettyServerHandler.class));
-        
typeDescribers.add(buildTypeDescriberWithDeclaredMethods(SslServerTlsHandler.class));
-        
typeDescribers.add(buildTypeDescriberWithDeclaredMethods(NettyClientHandler.class));
-        
typeDescribers.add(buildTypeDescriberWithDeclaredMethods(SslClientTlsHandler.class));
+        
typeDescribers.add(buildTypeDescriberWithPublicMethod(NettyServerHandler.class));
+        
typeDescribers.add(buildTypeDescriberWithPublicMethod(SslServerTlsHandler.class));
+        
typeDescribers.add(buildTypeDescriberWithPublicMethod(NettyClientHandler.class));
+        
typeDescribers.add(buildTypeDescriberWithPublicMethod(SslClientTlsHandler.class));
+        
typeDescribers.add(buildTypeDescriberWithPublicMethod(SelectorProvider.class));
+        
typeDescribers.add(buildTypeDescriberWithPublicMethod(NettyPortUnificationServerHandler.class));
+        
typeDescribers.add(buildTypeDescriberWithPublicMethod(NettyChannelHandler.class));
+        
typeDescribers.add(buildTypeDescriberWithPublicMethod(NettyConnectionHandler.class));
         return typeDescribers;
     }
 
-    private TypeDescriber buildTypeDescriberWithDeclaredMethods(Class<?> c){
+    private TypeDescriber buildTypeDescriberWithPublicMethod(Class<?> cl) {
         Set<MemberCategory> memberCategories = new HashSet<>();
-        memberCategories.add(MemberCategory.INVOKE_DECLARED_METHODS);
-        return new TypeDescriber(c.getName(), null, new HashSet<>(), new 
HashSet<>(), new HashSet<>(), memberCategories);
+        memberCategories.add(MemberCategory.INVOKE_PUBLIC_METHODS);
+        return new TypeDescriber(cl.getName(), null, new HashSet<>(), new 
HashSet<>(), new HashSet<>(), memberCategories);
     }
 }
diff --git a/dubbo-rpc/dubbo-rpc-triple/pom.xml 
b/dubbo-rpc/dubbo-rpc-triple/pom.xml
index 3160a9166e..1c28453239 100644
--- a/dubbo-rpc/dubbo-rpc-triple/pom.xml
+++ b/dubbo-rpc/dubbo-rpc-triple/pom.xml
@@ -86,6 +86,11 @@
             <artifactId>reactor-core</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.dubbo</groupId>
+            <artifactId>dubbo-native</artifactId>
+            <version>${project.parent.version}</version>
+        </dependency>
     </dependencies>
     <build>
         <plugins>
diff --git 
a/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/aot/Netty4ReflectionTypeDescriberRegistrar.java
 
b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/aot/TripleReflectionTypeDescriberRegistrar.java
similarity index 52%
copy from 
dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/aot/Netty4ReflectionTypeDescriberRegistrar.java
copy to 
dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/aot/TripleReflectionTypeDescriberRegistrar.java
index 051d590c2d..572cccd79b 100644
--- 
a/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/aot/Netty4ReflectionTypeDescriberRegistrar.java
+++ 
b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/aot/TripleReflectionTypeDescriberRegistrar.java
@@ -14,37 +14,39 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.dubbo.remoting.transport.netty4.aot;
+package org.apache.dubbo.rpc.protocol.tri.aot;
 
 import org.apache.dubbo.aot.api.MemberCategory;
 import org.apache.dubbo.aot.api.ReflectionTypeDescriberRegistrar;
 import org.apache.dubbo.aot.api.TypeDescriber;
-import org.apache.dubbo.remoting.transport.netty4.NettyClientHandler;
-import org.apache.dubbo.remoting.transport.netty4.NettyServerHandler;
-import org.apache.dubbo.remoting.transport.netty4.ssl.SslClientTlsHandler;
-import org.apache.dubbo.remoting.transport.netty4.ssl.SslServerTlsHandler;
+import org.apache.dubbo.rpc.protocol.tri.transport.TripleClientHandler;
+import 
org.apache.dubbo.rpc.protocol.tri.transport.TripleCommandOutBoundHandler;
+import 
org.apache.dubbo.rpc.protocol.tri.transport.TripleHttp2ClientResponseHandler;
+import 
org.apache.dubbo.rpc.protocol.tri.transport.TripleHttp2FrameServerHandler;
+import 
org.apache.dubbo.rpc.protocol.tri.transport.TripleServerConnectionHandler;
+import org.apache.dubbo.rpc.protocol.tri.transport.TripleTailHandler;
 
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
-
-public class Netty4ReflectionTypeDescriberRegistrar implements 
ReflectionTypeDescriberRegistrar {
-
+public class TripleReflectionTypeDescriberRegistrar implements 
ReflectionTypeDescriberRegistrar {
     @Override
     public List<TypeDescriber> getTypeDescribers() {
         List<TypeDescriber> typeDescribers = new ArrayList<>();
-        
typeDescribers.add(buildTypeDescriberWithDeclaredMethods(NettyServerHandler.class));
-        
typeDescribers.add(buildTypeDescriberWithDeclaredMethods(SslServerTlsHandler.class));
-        
typeDescribers.add(buildTypeDescriberWithDeclaredMethods(NettyClientHandler.class));
-        
typeDescribers.add(buildTypeDescriberWithDeclaredMethods(SslClientTlsHandler.class));
+        
typeDescribers.add(buildTypeDescriberWithPublicMethod(TripleHttp2FrameServerHandler.class));
+        
typeDescribers.add(buildTypeDescriberWithPublicMethod(TripleCommandOutBoundHandler.class));
+        
typeDescribers.add(buildTypeDescriberWithPublicMethod(TripleTailHandler.class));
+        
typeDescribers.add(buildTypeDescriberWithPublicMethod(TripleServerConnectionHandler.class));
+        
typeDescribers.add(buildTypeDescriberWithPublicMethod(TripleClientHandler.class));
+        
typeDescribers.add(buildTypeDescriberWithPublicMethod(TripleHttp2ClientResponseHandler.class));
         return typeDescribers;
     }
 
-    private TypeDescriber buildTypeDescriberWithDeclaredMethods(Class<?> c){
+    private TypeDescriber buildTypeDescriberWithPublicMethod(Class<?> c) {
         Set<MemberCategory> memberCategories = new HashSet<>();
-        memberCategories.add(MemberCategory.INVOKE_DECLARED_METHODS);
+        memberCategories.add(MemberCategory.INVOKE_PUBLIC_METHODS);
         return new TypeDescriber(c.getName(), null, new HashSet<>(), new 
HashSet<>(), new HashSet<>(), memberCategories);
     }
 }
diff --git 
a/dubbo-rpc/dubbo-rpc-triple/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.aot.api.ReflectionTypeDescriberRegistrar
 
b/dubbo-rpc/dubbo-rpc-triple/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.aot.api.ReflectionTypeDescriberRegistrar
new file mode 100644
index 0000000000..dee51291e1
--- /dev/null
+++ 
b/dubbo-rpc/dubbo-rpc-triple/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.aot.api.ReflectionTypeDescriberRegistrar
@@ -0,0 +1 @@
+tri=org.apache.dubbo.rpc.protocol.tri.aot.TripleReflectionTypeDescriberRegistrar

Reply via email to