diff options
author | zpencer <spencerfang@google.com> | 2018-04-13 14:10:28 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-13 14:10:28 -0700 |
commit | c50a57cd528e2760075d14f885528b2a8346c6ab (patch) | |
tree | 64d0029c80c0bfe784c78bebd574a63062e66fef /netty | |
parent | 03465a7f450ea2d026797fa782516bb25200a6a8 (diff) | |
download | grpc-grpc-java-c50a57cd528e2760075d14f885528b2a8346c6ab.tar.gz |
netty: fix visibility issues with InternalNettySocketSupport (#4335)
Previous version is not actually extendable from other packages.
Diffstat (limited to 'netty')
-rw-r--r-- | netty/src/main/java/io/grpc/netty/InternalNettySocketSupport.java | 14 | ||||
-rw-r--r-- | netty/src/main/java/io/grpc/netty/NettySocketSupport.java | 8 |
2 files changed, 17 insertions, 5 deletions
diff --git a/netty/src/main/java/io/grpc/netty/InternalNettySocketSupport.java b/netty/src/main/java/io/grpc/netty/InternalNettySocketSupport.java index 069fc3fb3..a73885e74 100644 --- a/netty/src/main/java/io/grpc/netty/InternalNettySocketSupport.java +++ b/netty/src/main/java/io/grpc/netty/InternalNettySocketSupport.java @@ -17,6 +17,8 @@ package io.grpc.netty; import io.grpc.Internal; +import io.grpc.internal.Channelz.TcpInfo; +import java.util.Map; /** * An internal accessor. Do not use. @@ -24,7 +26,17 @@ import io.grpc.Internal; @Internal public final class InternalNettySocketSupport { - public interface InternalHelper extends NettySocketSupport.Helper { } + public interface InternalHelper extends NettySocketSupport.Helper { + @Override + InternalNativeSocketOptions getNativeSocketOptions(io.netty.channel.Channel ch); + } + + public static final class InternalNativeSocketOptions + extends NettySocketSupport.NativeSocketOptions { + public InternalNativeSocketOptions(TcpInfo tcpInfo, Map<String, String> otherInfo) { + super(tcpInfo, otherInfo); + } + } public static void setHelper(InternalHelper helper) { NettySocketSupport.setHelper(helper); diff --git a/netty/src/main/java/io/grpc/netty/NettySocketSupport.java b/netty/src/main/java/io/grpc/netty/NettySocketSupport.java index e4de364a8..701dab53a 100644 --- a/netty/src/main/java/io/grpc/netty/NettySocketSupport.java +++ b/netty/src/main/java/io/grpc/netty/NettySocketSupport.java @@ -27,7 +27,7 @@ import javax.annotation.Nullable; * An class for getting low level socket info. */ final class NettySocketSupport { - private static volatile Helper INSTANCE = new NettySocketHelperImpl(); + private static volatile Helper instance = new NettySocketHelperImpl(); interface Helper { /** @@ -40,7 +40,7 @@ final class NettySocketSupport { /** * A TcpInfo and additional other info that will be turned into channelz socket options. */ - public static final class NativeSocketOptions { + public static class NativeSocketOptions { @Nullable public final TcpInfo tcpInfo; public final ImmutableMap<String, String> otherInfo; @@ -56,11 +56,11 @@ final class NettySocketSupport { } public static NativeSocketOptions getNativeSocketOptions(Channel ch) { - return INSTANCE.getNativeSocketOptions(ch); + return instance.getNativeSocketOptions(ch); } static void setHelper(Helper helper) { - INSTANCE = Preconditions.checkNotNull(helper); + instance = Preconditions.checkNotNull(helper); } private static final class NettySocketHelperImpl implements Helper { |