Interface WebServer

    • Method Detail

      • container

        Container container()
        Returns:
        container in which the application lives.
      • port

        int port()
        Returns:
        IP port the application listens to for requests.
      • start

        CompletionStage<?> start()
        Initiates server bootstrap.

        Startup happens in background. The completion stage produces a native startup result.

        Portable applications should not expect any particular result type, as it is implementation-specific.

        Returns:
        A CompletionStage providing a native startup result of the bootstrap process. The native result MAY be null.
      • stop

        CompletionStage<?> stop()
        Initiates server shutdown.

        Shutdown happens in background. The completion stage produces a native shutdown result.

        Portable applications should not expect any particular result type, as it is implementation-specific.

        Returns:
        A CompletionStage providing a native shutdown result of the shutdown process. The native result MAY be null.
      • unwrap

        <T> T unwrap​(Class<T> nativeClass)
        Provides access to the native handle(s) of the server, if it holds at least one.

        Implementations MAY use native handles to identify the server instance, and / or use those to communicate with and control the instance. Whether or not such handles exist, and their respective data types, is implementation-specific.

        Portable applications should not invoke this method, as the types of supported handles are implementation-specific.

        Parameters:
        nativeClass - The class of the native handle.
        Returns:
        The native handle, or null if no handle of this type exists.