Interface WebServerConfig

All Superinterfaces:
ListenerConfig, Prototype.Api, Prototype.Factory<WebServer>
All Known Implementing Classes:
WebServerConfig.BuilderBase.WebServerConfigImpl

public interface WebServerConfig extends Prototype.Api, ListenerConfig
WebServer configuration bean. See WebServer.create(java.util.function.Consumer).
See Also:
  • Method Details

    • builder

      static WebServerConfig.Builder builder()
      Create a new fluent API builder to customize configuration.
      Returns:
      a new builder
    • builder

      static WebServerConfig.Builder builder(WebServerConfig instance)
      Create a new fluent API builder from an existing instance.
      Parameters:
      instance - an existing instance used as a base for the builder
      Returns:
      a builder based on an instance
    • create

      static WebServerConfig create(Config config)
      Create a new instance from configuration.
      Parameters:
      config - used to configure the new instance
      Returns:
      a new instance configured from configuration
    • create

      @Deprecated static WebServerConfig create(Config config)
      Create a new instance from configuration.
      Parameters:
      config - used to configure the new instance
      Returns:
      a new instance configured from configuration
    • create

      static WebServerConfig create()
      Create a new instance with default values.
      Returns:
      a new instance
    • shutdownHook

      boolean shutdownHook()
      When true the webserver registers a shutdown hook with the JVM Runtime.

      Defaults to true. Set this to false such that a shutdown hook is not registered.

      Returns:
      whether to register a shutdown hook
    • sockets

      Socket configurations. Note that socket named "@default" cannot be used, configure the values on the server directly.
      Returns:
      map of listener configurations, except for the default one
    • namedRoutings

      Map<String,List<Builder<?,? extends Routing>>> namedRoutings()
      Routing for additional sockets. Note that socket named "@default" cannot be used, configure the routing on the server directly.
      Returns:
      map of routing
    • features

      List<ServerFeature> features()
      Server features allow customization of the server, listeners, or routings.
      Returns:
      server features
    • serverContext

      Optional<Context> serverContext()
      Context for the WebServer, if none defined, a new one will be created with global context as the root.
      Returns:
      server context
    • configureSocket

      default void configureSocket(ServerSocket socket)
      Update the server socket with configured socket options.
      Parameters:
      socket - socket to update