org.apache.hc.core5.http.impl.bootstrap

## Class HttpServer

- java.lang.Object
- - org.apache.hc.core5.http.impl.bootstrap.HttpServer

- All Implemented Interfaces:
    Closeable, AutoCloseable, ModalCloseable

      public class HttpServer
      extends Object
      implements ModalCloseable

  HTTP/1.1 server side message exchange handler.
  Since:
    4.4

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `HttpServer(int port, HttpService httpService, InetAddress ifAddress, SocketConfig socketConfig, ServerSocketFactory serverSocketFactory, HttpConnectionFactory<? extends DefaultBHttpServerConnection> connectionFactory, Callback<SSLParameters> sslSetupHandler, ExceptionListener exceptionListener)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `awaitTermination(TimeValue waitTime)`
    `void` | `close()`
    `void` | `close(CloseMode closeMode)` Closes this process or endpoint and releases any system resources associated with it.
    `void` | `close(CloseMode closeMode, Timeout timeout)` Closes this process or endpoint and releases any system resources associated with it.
    `InetAddress` | `getInetAddress()`
    `int` | `getLocalPort()`
    `void` | `initiateShutdown()`
    `void` | `start()`
    `void` | `stop()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### HttpServer

          @Internal
          public HttpServer(int port,
                                      HttpService httpService,
                                      InetAddress ifAddress,
                                      SocketConfig socketConfig,
                                      ServerSocketFactory serverSocketFactory,
                                      HttpConnectionFactory<? extends DefaultBHttpServerConnection> connectionFactory,
                                      Callback<SSLParameters> sslSetupHandler,
                                      ExceptionListener exceptionListener)

  - ### Method Detail

    - #### getInetAddress

          public InetAddress getInetAddress()

    - #### getLocalPort

          public int getLocalPort()

    - #### start

          public void start()
                     throws IOException

      Throws:
        `IOException`

    - #### stop

          public void stop()

    - #### initiateShutdown

          public void initiateShutdown()

    - #### awaitTermination

          public void awaitTermination(TimeValue waitTime)
                                throws InterruptedException

      Throws:
        `InterruptedException`

    - #### close

          public void close(CloseMode closeMode)

      Description copied from interface: `ModalCloseable`
      Closes this process or endpoint and releases any system resources associated with it. If the endpoint or the process is already closed then invoking this method has no effect.
      Specified by:
        `close` in interface `ModalCloseable`
      Parameters:
        `closeMode` - How to close the receiver.

    - #### close

          public void close(CloseMode closeMode,
                            Timeout timeout)

      Closes this process or endpoint and releases any system resources associated with it. If the endpoint or the process is already closed then invoking this method has no effect.
      Parameters:
        `closeMode` - How to close the receiver.
        `timeout` - How long to wait for the HttpServer to close gracefully.
      Since:
        5.2

    - #### close

          public void close()

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`

Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.