HttpServer.java 文件源码

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

项目:netty-rest 作者:
HttpServer(Set<HttpService> httpServicePlugins,
        Set<WebSocketService> websocketServices,
        Swagger swagger, EventLoopGroup eventLoopGroup,
        List<PreprocessorEntry> preProcessors,
        ImmutableList<PostProcessorEntry> postProcessors,
        ObjectMapper mapper,
        Map<Class, PrimitiveType> overriddenMappings,
        HttpServerBuilder.ExceptionHandler exceptionHandler,
        Map<String, IRequestParameterFactory> customParameters,
        BiConsumer<Method, Operation> swaggerOperationConsumer,
        boolean useEpoll,
        boolean proxyProtocol,
        long maximumBodySize)
{
    this.routeMatcher = new RouteMatcher();
    this.preProcessors = preProcessors;
    this.workerGroup = requireNonNull(eventLoopGroup, "eventLoopGroup is null");
    this.swagger = requireNonNull(swagger, "swagger is null");
    this.mapper = mapper;
    this.customParameters = customParameters;
    this.swaggerOperationConsumer = swaggerOperationConsumer;
    this.uncaughtExceptionHandler = exceptionHandler == null ? (t, e) -> {
    } : exceptionHandler;
    this.postProcessors = postProcessors;
    this.proxyProtocol = proxyProtocol;
    this.maximumBodySize = maximumBodySize;

    this.bossGroup = useEpoll ? new EpollEventLoopGroup(1) : new NioEventLoopGroup(1);
    registerEndPoints(requireNonNull(httpServicePlugins, "httpServices is null"), overriddenMappings);
    registerWebSocketPaths(requireNonNull(websocketServices, "webSocketServices is null"));
    routeMatcher.add(GET, "/api/swagger.json", this::swaggerApiHandle);
    this.useEpoll = useEpoll && Epoll.isAvailable();
    this.processingRequests = new ConcurrentHashMap<>();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号