Class ServerCdiExtension

  • All Implemented Interfaces:
    Extension

    public class ServerCdiExtension
    extends Object
    implements Extension
    Extension to handle web server configuration and lifecycle.
    • Constructor Detail

      • ServerCdiExtension

        public ServerCdiExtension()
    • Method Detail

      • routingBuilder

        public Routing.Builder routingBuilder​(Optional<String> namedRouting,
                                              boolean routingNameRequired,
                                              String appName)
        Provides access to routing builder.
        Parameters:
        namedRouting - Named routing.
        routingNameRequired - Routing name required.
        appName - Application's name.
        Returns:
        The routing builder.
      • serverBuilder

        public WebServer.Builder serverBuilder()
        Helidon web server configuration builder that can be used to re-configure the web server.
        Returns:
        web server configuration builder
      • serverRoutingBuilder

        public Routing.Builder serverRoutingBuilder()
        Helidon webserver routing builder that can be used to add routes to the webserver.
        Returns:
        server routing builder
      • serverNamedRoutingBuilder

        public Routing.Builder serverNamedRoutingBuilder​(String name)
        Helidon webserver routing builder that can be used to add routes to a named socket of the webserver.
        Parameters:
        name - name of the named routing (should match a named socket configuration)
        Returns:
        builder for routing of the named route
      • defaultExecutorService

        public void defaultExecutorService​(Supplier<? extends ExecutorService> defaultExecutorService)
        Configure the default executor service to be used by this server.
        Parameters:
        defaultExecutorService - executor service supplier
      • host

        public String host()
        Current host the server is running on.
        Returns:
        host of this server
      • port

        public int port()
        Current port the server is running on. This information is only available after the server is actually started.
        Returns:
        port the server is running on
      • port

        public int port​(String name)
        Named port the server is running on. This information is only available after the server is actually started.
        Parameters:
        name - Socket name
        Returns:
        Named port the server is running on
      • started

        public boolean started()
        State of the server.
        Returns:
        true if the server is already started, false otherwise
      • basePath

        public void basePath​(String basePath)
        Base path of this server. This is used to redirect when a request is made for root ("/").
        Parameters:
        basePath - path to redirect to when user requests the root path