From d83376703715a8a134d3d5aa2db0a206c08e741c Mon Sep 17 00:00:00 2001 From: Carl Mastrangelo Date: Tue, 5 Mar 2019 11:29:32 -0800 Subject: [PATCH] netty: expose some of the reusable handlers in ProtocolNegotiators --- .../grpc/netty/InternalProtocolNegotiators.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/netty/src/main/java/io/grpc/netty/InternalProtocolNegotiators.java b/netty/src/main/java/io/grpc/netty/InternalProtocolNegotiators.java index eaaf973d0b..8af607a7f2 100644 --- a/netty/src/main/java/io/grpc/netty/InternalProtocolNegotiators.java +++ b/netty/src/main/java/io/grpc/netty/InternalProtocolNegotiators.java @@ -16,6 +16,8 @@ package io.grpc.netty; +import io.grpc.netty.ProtocolNegotiators.GrpcNegotiationHandler; +import io.grpc.netty.ProtocolNegotiators.WaitUntilActiveHandler; import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.ssl.SslContext; @@ -69,4 +71,18 @@ public final class InternalProtocolNegotiators { return new TlsNegotiator(); } + + /** + * Internal version of {@link WaitUntilActiveHandler}. + */ + public static ChannelHandler waitUntilActiveHandler(ChannelHandler next) { + return new WaitUntilActiveHandler(next); + } + + /** + * Internal version of {@link GrpcNegotiationHandler}. + */ + public static ChannelHandler grpcNegotiationHandler(GrpcHttp2ConnectionHandler next) { + return new GrpcNegotiationHandler(next); + } }