public JettyService build() {
        // Make a copy of the properties that's used in `serverFactory` so that any further modification of
        // this builder doesn't affect the built server.
        final Boolean dumpAfterStart = this.dumpAfterStart;
        final Boolean dumpBeforeStop = this.dumpBeforeStop;
        final Long stopTimeoutMillis = this.stopTimeoutMillis;
        final Handler handler = this.handler;
        final RequestLog requestLog = this.requestLog;
        final Function<? super Server, ? extends SessionIdManager> sessionIdManagerFactory =
                this.sessionIdManagerFactory;
        final Map<String, Object> attrs = this.attrs.build();
        final List<Bean> beans = this.beans.build();
        final List<HandlerWrapper> handlerWrappers = this.handlerWrappers.build();
        final List<Container.Listener> eventListeners = this.eventListeners.build();
        final List<LifeCycle.Listener> lifeCycleListeners = this.lifeCycleListeners.build();
        final List<Consumer<? super Server>> customizers = this.customizers.build();

        final Function<BlockingTaskExecutor, Server> serverFactory = blockingTaskExecutor -> {
            final Server server = new Server(new ArmeriaThreadPool(blockingTaskExecutor));

            if (dumpAfterStart != null) {
                server.setDumpAfterStart(dumpAfterStart);
            }
            if (dumpBeforeStop != null) {
                server.setDumpBeforeStop(dumpBeforeStop);
            }
            if (stopTimeoutMillis != null) {
                server.setStopTimeout(stopTimeoutMillis);
            }

            if (handler != null) {
                server.setHandler(handler);
            }
            if (requestLog != null) {
                server.setRequestLog(requestLog);
            }
            if (sessionIdManagerFactory != null) {
                server.setSessionIdManager(sessionIdManagerFactory.apply(server));
            }

            handlerWrappers.forEach(server::insertHandler);
            attrs.forEach(server::setAttribute);
            beans.forEach(bean -> {
                final Boolean managed = bean.isManaged();
                if (managed == null) {
                    server.addBean(bean.bean());
                } else {
                    server.addBean(bean.bean(), managed);
                }
            });

            eventListeners.forEach(server::addEventListener);
            lifeCycleListeners.forEach(server::addLifeCycleListener);

            customizers.forEach(c -> c.accept(server));

            return server;
        };

        final Consumer<Server> postStopTask = server -> {
            try {
                JettyService.logger.info("Destroying an embedded Jetty: {}", server);
                server.destroy();
            } catch (Exception e) {
                JettyService.logger.warn("Failed to destroy an embedded Jetty: {}", server, e);
            }
        };

        return new JettyService(hostname, tlsReverseDnsLookup, serverFactory, postStopTask);
    }
Returns a newly-created {@link JettyService} based on the properties of this builder.
jetty/jetty9/src/main/java/com/linecorp/armeria/server/jetty/JettyServiceBuilder.java