当前位置: 首页>>代码示例>>Java>>正文


Java Http2FrameLogger类代码示例

本文整理汇总了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());
}
 
开发者ID:chhsiao90,项目名称:nitmproxy,代码行数:20,代码来源:Http2FrontendHandler.java

示例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());
}
 
开发者ID:chhsiao90,项目名称:nitmproxy,代码行数:20,代码来源:Http2BackendHandler.java

示例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;
}
 
开发者ID:jooby-project,项目名称:jooby,代码行数:17,代码来源:NettyPipeline.java

示例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);
}
 
开发者ID:grpc,项目名称:grpc-java,代码行数:43,代码来源:NettyServerHandler.java

示例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);
}
 
开发者ID:relayrides,项目名称:pushy,代码行数:42,代码来源:ApnsClient.java

示例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;
}
 
开发者ID:relayrides,项目名称:pushy,代码行数:19,代码来源:ApnsClientBuilder.java


注:本文中的io.netty.handler.codec.http2.Http2FrameLogger类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。