Class DefaultHttpServer

java.lang.Object
cloud.piranha.http.impl.DefaultHttpServer
All Implemented Interfaces:
HttpServer

public class DefaultHttpServer extends Object implements HttpServer
The default implementation of a HTTP Server.

When you create the DefaultHttpServer with a port number of -2, it will automatically assign a random port in the range of 1025-9999 when you call start(). You can determine which port was assigned by calling getServerPort().

Author:
Manfred Riem (mriem@manorrock.com)
  • Field Details

    • executorService

      protected ExecutorService executorService
      Stores the executor service.
    • processor

      protected HttpServerProcessor processor
      Stores the processor.
    • serverPort

      protected int serverPort
      Stores the port we are listening on.
    • serverAcceptorThread

      protected Thread serverAcceptorThread
      Stores the server acceptor thread.
    • serverSocket

      protected ServerSocket serverSocket
      Stores the server socket.
    • serverStopRequest

      protected boolean serverStopRequest
      Stores the server stop request.
    • soTimeout

      protected int soTimeout
      Stores the SO_TIMEOUT.
    • ssl

      protected boolean ssl
      Stores the SSL flag.
    • threadFactory

      protected ThreadFactory threadFactory
      Stores the thread factory.
  • Constructor Details

    • DefaultHttpServer

      public DefaultHttpServer()
      Constructor
    • DefaultHttpServer

      public DefaultHttpServer(int serverPort)
      Constructor.
      Parameters:
      serverPort - the server port.
    • DefaultHttpServer

      public DefaultHttpServer(int serverPort, HttpServerProcessor processor, boolean ssl)
      Constructor
      Parameters:
      serverPort - the server port.
      processor - the HTTP server processor.
      ssl - the SSL flag.
    • DefaultHttpServer

      public DefaultHttpServer(int serverPort, HttpServerProcessor processor, int soTimeout)
      Constructor
      Parameters:
      serverPort - the server port.
      processor - the HTTP server processor.
      soTimeout - the SO_TIMEOUT.
  • Method Details