@Override
    public synchronized void start() {
        try {
            if (!isRunning) {
                server.start().get();
                if (port == 0) {
                    // Replace the specified port number with the primary port number.
                    // Server#activePort doesn't return the first added port, so we need to find that.
                    final Optional<ServerPort> port =
                            server.activePorts().values().stream()
                                  .filter(p -> p.protocols().contains(protocol))
                                  .filter(p -> address == null ||
                                               Arrays.equals(address.getAddress(),
                                                             p.localAddress().getAddress().getAddress()))
                                  .findFirst();
                    assert port.isPresent() : "the primary port doest not exist.";
                    this.port = port.get().localAddress().getPort();
                }
                beanFactory.registerSingleton("server", server);
                final ArmeriaBeanPostProcessor beanPostProcessor = new ArmeriaBeanPostProcessor(beanFactory);
                beanFactory.addBeanPostProcessor(beanPostProcessor);
                isRunning = true;
            }
        } catch (Exception cause) {
            throw new WebServerException("Failed to start " + ArmeriaWebServer.class.getSimpleName() +
                                         ". server: " + server + ", primary port: " + port,
                                         Exceptions.peel(cause));
        }
    }
Creates a new {@link WebServer} instance with the specified Armeria {@link Server}.

@param server the Armeria server
@param protocol the session protocol which is used for the primary port
@param address the primary local address that the server will be bound to
@param port the primary local port that the server will be bound to
@param beanFactory the bean factory that adding {@link ArmeriaBeanPostProcessor} to
                   the application context.
spring/boot3-webflux-autoconfigure/src/main/java/com/linecorp/armeria/spring/web/reactive/ArmeriaWebServer.java