HttpChannelizer.java 文件源码

java
阅读 25 收藏 0 点赞 0 评论 0

项目:LiteGraph 作者:
@Override
public void configure(final ChannelPipeline pipeline) {
    if (logger.isDebugEnabled())
        pipeline.addLast(new LoggingHandler("log-io", LogLevel.DEBUG));

    pipeline.addLast("http-server", new HttpServerCodec());

    if (logger.isDebugEnabled())
        pipeline.addLast(new LoggingHandler("http-io", LogLevel.DEBUG));

    pipeline.addLast(new HttpObjectAggregator(settings.maxContentLength));

    if (authenticator != null) {
        // Cannot add the same handler instance to multiple times unless
        // it is marked as @Sharable, indicating a race condition will
        // not occur. It may not be a safe assumption that the handler
        // is sharable so create a new handler each time.
        authenticationHandler = authenticator.getClass() == AllowAllAuthenticator.class ?
                null : new HttpBasicAuthenticationHandler(authenticator);
        if (authenticationHandler != null)
            pipeline.addLast(PIPELINE_AUTHENTICATOR, authenticationHandler);
    }

    pipeline.addLast("http-gremlin-handler", httpGremlinEndpointHandler);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号