Interface ServerConfiguration

All Superinterfaces:
SocketConfiguration

public interface ServerConfiguration extends SocketConfiguration
WebServer configuration.
  • Method Details

    • workersCount

      int workersCount()
      Returns the count of threads in the pool used to process HTTP requests.

      Default value is Runtime.availableProcessors().

      Returns:
      a workers count
    • port

      int port()
      Returns a server port to listen on with the default server socket. If port is 0 then any available ephemeral port will be used.

      Additional named server socket configuration is accessible through the socket(String) and sockets() methods.

      Specified by:
      port in interface SocketConfiguration
      Returns:
      the server port of the default server socket
    • bindAddress

      InetAddress bindAddress()
      Returns local address where the server listens on with the default server socket. If null then listens an all local addresses.

      Additional named server socket configuration is accessible through the socket(String) and sockets() methods.

      Specified by:
      bindAddress in interface SocketConfiguration
      Returns:
      an address to bind with the default server socket; null for all local addresses
    • backlog

      int backlog()
      Returns a maximum length of the queue of incoming connections on the default server socket.

      Default value is SocketConfiguration.DEFAULT_BACKLOG_SIZE.

      Additional named server socket configuration is accessible through the socket(String) and sockets() methods.

      Specified by:
      backlog in interface SocketConfiguration
      Returns:
      a maximum length of the queue of incoming connections
    • timeoutMillis

      int timeoutMillis()
      Returns a default server socket timeout in milliseconds or 0 for an infinite timeout.

      Additional named server socket configuration is accessible through the socket(String) and sockets() methods.

      Specified by:
      timeoutMillis in interface SocketConfiguration
      Returns:
      a default server socket timeout in milliseconds or 0
    • receiveBufferSize

      int receiveBufferSize()
      Returns proposed value of the TCP receive window that is advertised to the remote peer on the default server socket.

      If 0 then use implementation default.

      Additional named server socket configuration is accessible through the socket(String) and sockets() methods.

      Specified by:
      receiveBufferSize in interface SocketConfiguration
      Returns:
      a buffer size in bytes of the default server socket or 0
    • socket

      @Deprecated default SocketConfiguration socket(String name)
      Deprecated.
      since 2.0.0, please use namedSocket(String) instead
      A socket configuration of an additional named server socket.

      An additional named server socket may have a dedicated Routing configured through WebServer.Builder.addNamedRouting(String, Routing).

      Parameters:
      name - the name of the additional server socket
      Returns:
      an additional named server socket configuration or null if there is no such named server socket
    • namedSocket

      default Optional<SocketConfiguration> namedSocket(String name)
      A socket configuration of an additional named server socket.

      An additional named server socket may have a dedicated Routing configured through WebServer.Builder.addNamedRouting(String, Routing).

      Parameters:
      name - the name of the additional server socket
      Returns:
      an additional named server socket configuration or empty if there is no such named server socket configured
    • sockets

      A map of all the configured server sockets; that is the default server socket which is identified by the key WebServer.DEFAULT_SOCKET_NAME and also all the additional named server socket configurations.

      An additional named server socket may have a dedicated Routing configured through WebServer.Builder.addNamedRouting(String, Routing).

      Returns:
      a map of all the configured server sockets, never null
    • maxShutdownTimeout

      default Duration maxShutdownTimeout()
      The maximum amount of time that the server will wait to shut down regardless of the value of any additionally requested quiet period.

      The default implementation of this method returns Duration.ofSeconds(10L).

      Returns:
      the Duration to use
    • shutdownQuietPeriod

      default Duration shutdownQuietPeriod()
      The quiet period during which the webserver will wait for new incoming connections after it has been told to shut down.

      The webserver will wait no longer than the duration returned by the maxShutdownTimeout() method.

      The default implementation of this method returns Duration.ofSeconds(0L), indicating that there will be no quiet period.

      Returns:
      the Duration to use
    • tracer

      Tracer tracer()
      Returns a Tracer.
      Returns:
      a tracer to use - never null
    • context

      io.helidon.common.context.Context context()
      The top level Context to be used by this webserver.
      Returns:
      a context instance with registered application scoped instances
    • transport

      default Optional<Transport> transport()
      Returns an optional Transport.
      Returns:
      an optional Transport
    • printFeatureDetails

      boolean printFeatureDetails()
      Whether to print details of HelidonFeatures.
      Returns:
      whether to print details
    • create

      static ServerConfiguration create(Config config)
      Creates new instance with defaults from external configuration source.
      Parameters:
      config - the externalized configuration
      Returns:
      a new instance
    • builder

      Deprecated.
      since 2.0.0 - please use WebServer.builder() instead
      Creates new instance of a server configuration builder.
      Returns:
      a new builder instance
    • builder

      Creates new instance of a server configuration builder with defaults from external configuration source.
      Parameters:
      config - the externalized configuration
      Returns:
      a new builder instance