You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "FoghostCn (via GitHub)" <gi...@apache.org> on 2023/06/16 02:28:30 UTC

[GitHub] [dubbo] FoghostCn commented on a diff in pull request #12536: add tri native image support

FoghostCn commented on code in PR #12536:
URL: https://github.com/apache/dubbo/pull/12536#discussion_r1231714670


##########
dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/aot/Netty4ReflectionTypeDescriberRegistrar.java:
##########
@@ -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);

Review Comment:
   cause to method https://github.com/netty/netty/blob/4.1/transport/src/main/java/io/netty/channel/ChannelHandlerMask.java#L167 public is enough and reflect config in netty project  is also public, for example:
   
   ```json
     {
       "name": "io.netty.channel.ChannelDuplexHandler",
       "condition": {
         "typeReachable": "io.netty.channel.ChannelDuplexHandler"
       },
       "queryAllPublicMethods": true
     }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org