Skip to content

Commit

Permalink
fix(java): initialize netty-shaded at run-time and add reflection con…
Browse files Browse the repository at this point in the history
…figurations for netty classes (#1290)

* fix(java): initialize netty-shaded at run-time and add reflection configurations for netty classes
  • Loading branch information
mpeddada1 authored and lqiu96 committed Feb 23, 2023
1 parent 5b31d41 commit 316621c
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,26 @@ private static void loadGrpcNettyClasses(BeforeAnalysisAccess access) {
registerClassForReflection(access, "io.grpc.netty.shaded.io.netty.channel.DefaultFileRegion");
registerClassForReflection(
access, "io.grpc.netty.shaded.io.netty.channel.unix.PeerCredentials");
registerClassForReflection(
access, "io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline");
registerClassForReflection(
access, "io.grpc.netty.shaded.io.grpc.netty.WriteBufferingAndExceptionHandler");
registerClassForReflection(
access, "io.grpc.netty.shaded.io.netty.channel.ProtocolNegotiators");
registerClassForReflection(access, "io.grpc.netty.shaded.io.netty.handler.ssl.SslHandler");
registerClassForReflection(access, "io.grpc.netty.shaded.io.grpc.netty.NettyClientHandler");
registerClassForReflection(
access, "io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline$HeadContext");
registerClassForReflection(
access, "io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline$TailContext");
registerClassForReflection(
access, "io.grpc.netty.shaded.io.grpc.netty.ProtocolNegotiators$WaitUntilActiveHandler");
registerClassForReflection(
access, "io.grpc.netty.shaded.io.grpc.netty.ProtocolNegotiators$ClientTlsHandler");
registerClassForReflection(
access, "io.grpc.netty.shaded.io.grpc.netty.ProtocolNegotiators$GrpcNegotiationHandler");
registerClassForReflection(
access, "io.grpc.netty.shaded.io.netty.channel.ChannelHandlerMask");

// Epoll Libraries
registerClassForReflection(access, "io.grpc.netty.shaded.io.netty.channel.epoll.Epoll");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Args=--add-opens=java.base/java.time=ALL-UNNAMED \
io.grpc.netty.shaded.io.netty.channel.epoll,\
io.grpc.netty.shaded.io.netty.channel.unix,\
io.grpc.netty.shaded.io.netty.handler.ssl,\
io.grpc.internal.RetriableStream \
io.grpc.internal.RetriableStream,\
io.grpc.netty.shaded.io.netty \
--features=com.google.api.gax.grpc.nativeimage.ProtobufMessageFeature,\
com.google.api.gax.grpc.nativeimage.GrpcNettyFeature \
-H:-RunReachabilityHandlersConcurrently
Original file line number Diff line number Diff line change
Expand Up @@ -283,5 +283,44 @@
"name": "selectedKeys"
}
]
},
{
"name" : "com.google.auth.oauth2.ServiceAccountCredentials",
"allDeclaredConstructors" : true,
"allPublicConstructors" : true,
"allDeclaredMethods" : true,
"allPublicMethods" : true,
"allDeclaredFields" : true,
"allPublicFields" : true,
"queryAllPublicConstructors" : true,
"queryAllDeclaredConstructors" : true,
"queryAllPublicMethods" : true,
"queryAllDeclaredMethods" : true
},
{
"name" : "org.apache.commons.pool2.impl.DefaultEvictionPolicy",
"allDeclaredConstructors" : true,
"allPublicConstructors" : true,
"allDeclaredMethods" : true,
"allPublicMethods" : true,
"allDeclaredFields" : true,
"allPublicFields" : true,
"queryAllPublicConstructors" : true,
"queryAllDeclaredConstructors" : true,
"queryAllPublicMethods" : true,
"queryAllDeclaredMethods" : true
},
{
"name" : "java.nio.channels.spi.SelectorProvider",
"allDeclaredConstructors" : true,
"allPublicConstructors" : true,
"allDeclaredMethods" : true,
"allPublicMethods" : true,
"allDeclaredFields" : true,
"allPublicFields" : true,
"queryAllPublicConstructors" : true,
"queryAllDeclaredConstructors" : true,
"queryAllPublicMethods" : true,
"queryAllDeclaredMethods" : true
}
]

0 comments on commit 316621c

Please sign in to comment.