org.apache.avro.ipc.jetty

## Class HttpServer

- java.lang.Object
- - org.apache.avro.ipc.jetty.HttpServer

- All Implemented Interfaces:
    Server

      public class HttpServer
      extends Object
      implements Server

  An HTTP-based RPC `Server`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `HttpServer(Responder responder, org.eclipse.jetty.server.ConnectionFactory connectionFactory, String bindAddress, int port)` Constructs a server to run with the given ConnectionFactory on the given address/port.
    `HttpServer(Responder responder, org.eclipse.jetty.server.Connector connector)` Deprecated. - use the Constructors that take a ConnectionFactory
    `HttpServer(Responder responder, InetSocketAddress addr)` Constructs a server to run on the named port on the specified address.
    `HttpServer(Responder responder, int port)` Constructs a server to run on the named port.
    `HttpServer(ResponderServlet servlet, org.eclipse.jetty.server.ConnectionFactory connectionFactory, String bindAddress, int port)` Constructs a server to run with the given ConnectionFactory on the given address/port.
    `HttpServer(ResponderServlet servlet, org.eclipse.jetty.server.Connector connector)` Deprecated. - use the Constructors that take a ConnectionFactory
    `HttpServer(ResponderServlet servlet, int port)` Constructs a server to run on the named port.
    `HttpServer(ResponderServlet servlet, String bindAddress, int port)` Constructs a server to run on the named port on the specified address.
    `HttpServer(Responder responder, String bindAddress, int port)` Constructs a server to run on the named port on the specified address.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addConnector(org.eclipse.jetty.server.Connector connector)`
    `void` | `close()` Stop this server.
    `int` | `getPort()` The port this server runs on.
    `void` | `join()` Wait for this server to exit.
    `void` | `start()` Start the server.

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

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

- - ### Constructor Detail

    - #### HttpServer

          public HttpServer(Responder responder,
                            int port)
                     throws IOException

      Constructs a server to run on the named port.
      Throws:
        `IOException`

    - #### HttpServer

          public HttpServer(ResponderServlet servlet,
                            int port)
                     throws IOException

      Constructs a server to run on the named port.
      Throws:
        `IOException`

    - #### HttpServer

          public HttpServer(Responder responder,
                            InetSocketAddress addr)
                     throws IOException

      Constructs a server to run on the named port on the specified address.
      Throws:
        `IOException`

    - #### HttpServer

          public HttpServer(Responder responder,
                            String bindAddress,
                            int port)
                     throws IOException

      Constructs a server to run on the named port on the specified address.
      Throws:
        `IOException`

    - #### HttpServer

          public HttpServer(ResponderServlet servlet,
                            String bindAddress,
                            int port)
                     throws IOException

      Constructs a server to run on the named port on the specified address.
      Throws:
        `IOException`

    - #### HttpServer

          public HttpServer(Responder responder,
                            org.eclipse.jetty.server.ConnectionFactory connectionFactory,
                            String bindAddress,
                            int port)
                     throws IOException

      Constructs a server to run with the given ConnectionFactory on the given address/port.
      Throws:
        `IOException`

    - #### HttpServer

          public HttpServer(ResponderServlet servlet,
                            org.eclipse.jetty.server.ConnectionFactory connectionFactory,
                            String bindAddress,
                            int port)
                     throws IOException

      Constructs a server to run with the given ConnectionFactory on the given address/port.
      Throws:
        `IOException`

    - #### HttpServer

          @Deprecated
          public HttpServer(ResponderServlet servlet,
                                        org.eclipse.jetty.server.Connector connector)
                                 throws IOException

      Deprecated. - use the Constructors that take a ConnectionFactory
      Constructs a server to run with the given connector.
      Throws:
        `IOException`

    - #### HttpServer

          @Deprecated
          public HttpServer(Responder responder,
                                        org.eclipse.jetty.server.Connector connector)
                                 throws IOException

      Deprecated. - use the Constructors that take a ConnectionFactory
      Constructs a server to run with the given connector.
      Throws:
        `IOException`

  - ### Method Detail

    - #### addConnector

          public void addConnector(org.eclipse.jetty.server.Connector connector)

    - #### getPort

          public int getPort()

      Description copied from interface: `Server`
      The port this server runs on.
      Specified by:
        `getPort` in interface `Server`

    - #### close

          public void close()

      Description copied from interface: `Server`
      Stop this server.
      Specified by:
        `close` in interface `Server`

    - #### start

          public void start()

      Start the server.
      Specified by:
        `start` in interface `Server`
      Throws:
        `AvroRuntimeException` - if the underlying Jetty server throws any exception while starting.

    - #### join

          public void join()
                    throws InterruptedException

      Description copied from interface: `Server`
      Wait for this server to exit.
      Specified by:
        `join` in interface `Server`
      Throws:
        `InterruptedException`

Copyright © 2009–2024 The Apache Software Foundation. All rights reserved.