本文整理汇总了Java中io.netty.handler.codec.http2.Http2FrameLogger类的典型用法代码示例。如果您正苦于以下问题:Java Http2FrameLogger类的具体用法?Java Http2FrameLogger怎么用?Java Http2FrameLogger使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Http2FrameLogger类属于io.netty.handler.codec.http2包,在下文中一共展示了Http2FrameLogger类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handlerAdded
import io.netty.handler.codec.http2.Http2FrameLogger; //导入依赖的package包/类
@Override
public void handlerAdded(ChannelHandlerContext ctx) throws Exception {
LOGGER.info("{} : handlerAdded", connectionInfo);
Http2Connection connection = new DefaultHttp2Connection(true);
ChannelHandler http2ConnHandler = new HttpToHttp2ConnectionHandlerBuilder()
.frameListener(new DelegatingDecompressorFrameListener(
connection,
new InboundHttp2ToHttpAdapterBuilder(connection)
.maxContentLength(master.config().getMaxContentLength())
.propagateSettings(true)
.build()))
.connection(connection)
.frameLogger(new Http2FrameLogger(LogLevel.DEBUG))
.build();
ctx.pipeline()
.addBefore(ctx.name(), null, http2ConnHandler)
.addBefore(ctx.name(), null, new Http2Handler());
}
示例2: handlerAdded
import io.netty.handler.codec.http2.Http2FrameLogger; //导入依赖的package包/类
@Override
public void handlerAdded(ChannelHandlerContext ctx) throws Exception {
LOGGER.info("{} : handlerAdded", connectionInfo);
Http2Connection connection = new DefaultHttp2Connection(false);
ChannelHandler http2ConnHandler = new HttpToHttp2ConnectionHandlerBuilder()
.frameListener(new DelegatingDecompressorFrameListener(
connection,
new InboundHttp2ToHttpAdapterBuilder(connection)
.maxContentLength(master.config().getMaxContentLength())
.propagateSettings(true)
.build()))
.frameLogger(new Http2FrameLogger(LogLevel.DEBUG))
.connection(connection)
.build();
ctx.pipeline()
.addBefore(ctx.name(), null, http2ConnHandler)
.addBefore(ctx.name(), null, new Http2Handler());
}
示例3: newHttp2ConnectionHandler
import io.netty.handler.codec.http2.Http2FrameLogger; //导入依赖的package包/类
private Http2ConnectionHandler newHttp2ConnectionHandler(final ChannelPipeline p) {
DefaultHttp2Connection connection = new DefaultHttp2Connection(true);
InboundHttp2ToHttpAdapter listener = new InboundHttp2ToHttpAdapterBuilder(connection)
.propagateSettings(false)
.validateHttpHeaders(false)
.maxContentLength(maxContentLength)
.build();
HttpToHttp2ConnectionHandler http2handler = new HttpToHttp2ConnectionHandlerBuilder()
.frameListener(listener)
.frameLogger(new Http2FrameLogger(LogLevel.DEBUG))
.connection(connection)
.build();
return http2handler;
}
示例4: newHandler
import io.netty.handler.codec.http2.Http2FrameLogger; //导入依赖的package包/类
static NettyServerHandler newHandler(
ServerTransportListener transportListener,
ChannelPromise channelUnused,
List<ServerStreamTracer.Factory> streamTracerFactories,
TransportTracer transportTracer,
int maxStreams,
int flowControlWindow,
int maxHeaderListSize,
int maxMessageSize,
long keepAliveTimeInNanos,
long keepAliveTimeoutInNanos,
long maxConnectionIdleInNanos,
long maxConnectionAgeInNanos,
long maxConnectionAgeGraceInNanos,
boolean permitKeepAliveWithoutCalls,
long permitKeepAliveTimeInNanos) {
Preconditions.checkArgument(maxHeaderListSize > 0, "maxHeaderListSize must be positive");
Http2FrameLogger frameLogger = new Http2FrameLogger(LogLevel.DEBUG, NettyServerHandler.class);
Http2HeadersDecoder headersDecoder = new GrpcHttp2ServerHeadersDecoder(maxHeaderListSize);
Http2FrameReader frameReader = new Http2InboundFrameLogger(
new DefaultHttp2FrameReader(headersDecoder), frameLogger);
Http2FrameWriter frameWriter =
new Http2OutboundFrameLogger(new DefaultHttp2FrameWriter(), frameLogger);
return newHandler(
channelUnused,
frameReader,
frameWriter,
transportListener,
streamTracerFactories,
transportTracer,
maxStreams,
flowControlWindow,
maxHeaderListSize,
maxMessageSize,
keepAliveTimeInNanos,
keepAliveTimeoutInNanos,
maxConnectionIdleInNanos,
maxConnectionAgeInNanos,
maxConnectionAgeGraceInNanos,
permitKeepAliveWithoutCalls,
permitKeepAliveTimeInNanos);
}
示例5: ApnsClient
import io.netty.handler.codec.http2.Http2FrameLogger; //导入依赖的package包/类
protected ApnsClient(final InetSocketAddress apnsServerAddress, final SslContext sslContext,
final ApnsSigningKey signingKey, final ProxyHandlerFactory proxyHandlerFactory,
final int connectTimeoutMillis, final long idlePingIntervalMillis,
final long gracefulShutdownTimeoutMillis, final int concurrentConnections,
final ApnsClientMetricsListener metricsListener, final Http2FrameLogger frameLogger,
final EventLoopGroup eventLoopGroup) {
if (eventLoopGroup != null) {
this.eventLoopGroup = eventLoopGroup;
this.shouldShutDownEventLoopGroup = false;
} else {
this.eventLoopGroup = new NioEventLoopGroup(1);
this.shouldShutDownEventLoopGroup = true;
}
this.metricsListener = metricsListener != null ? metricsListener : new NoopApnsClientMetricsListener();
final ApnsChannelFactory channelFactory = new ApnsChannelFactory(sslContext, signingKey, proxyHandlerFactory,
connectTimeoutMillis, idlePingIntervalMillis, gracefulShutdownTimeoutMillis, frameLogger,
apnsServerAddress, this.eventLoopGroup);
final ApnsChannelPoolMetricsListener channelPoolMetricsListener = new ApnsChannelPoolMetricsListener() {
@Override
public void handleConnectionAdded() {
ApnsClient.this.metricsListener.handleConnectionAdded(ApnsClient.this);
}
@Override
public void handleConnectionRemoved() {
ApnsClient.this.metricsListener.handleConnectionRemoved(ApnsClient.this);
}
@Override
public void handleConnectionCreationFailed() {
ApnsClient.this.metricsListener.handleConnectionCreationFailed(ApnsClient.this);
}
};
this.channelPool = new ApnsChannelPool(channelFactory, concurrentConnections, this.eventLoopGroup.next(), channelPoolMetricsListener);
}
示例6: setFrameLogger
import io.netty.handler.codec.http2.Http2FrameLogger; //导入依赖的package包/类
/**
* Sets the HTTP/2 frame logger for the client under construction. HTTP/2 frame loggers log all HTTP/2 frames sent
* to or from the client to the logging system of your choice via SLF4J. Frame logging is extremely verbose and is
* recommended only for debugging purposes.
*
* @param frameLogger the frame logger to be used by the client under construction or {@code null} if the client
* should not log individual HTTP/2 frames
*
* @return a reference to this builder
*
* @see <a href="https://www.slf4j.org/">SLF4J</a>
*
* @since 0.12
*/
public ApnsClientBuilder setFrameLogger(final Http2FrameLogger frameLogger) {
this.frameLogger = frameLogger;
return this;
}