cloud.piranha.api.HttpServer
public class DefaultHttpServer
extends java.lang.Object
implements cloud.piranha.api.HttpServer
Modifier and Type | Field | Description |
---|---|---|
protected java.util.concurrent.ExecutorService |
executorService |
Stores the executor service.
|
protected cloud.piranha.api.HttpServerProcessor |
processor |
Stores the processor.
|
protected java.lang.Thread |
serverAcceptorThread |
Stores the server acceptor thread.
|
protected int |
serverPort |
Stores the port we are listening on.
|
protected java.net.ServerSocket |
serverSocket |
Stores the server socket.
|
protected boolean |
serverStopRequest |
Stores the server stop request.
|
protected int |
soTimeout |
Stores the SO_TIMEOUT.
|
protected java.util.concurrent.ThreadFactory |
threadFactory |
Stores the thread factory.
|
Constructor | Description |
---|---|
DefaultHttpServer() |
Constructor
|
DefaultHttpServer(int serverPort,
cloud.piranha.api.HttpServerProcessor processor) |
Constructor
|
DefaultHttpServer(int serverPort,
cloud.piranha.api.HttpServerProcessor processor,
int soTimeout) |
Constructor
|
Modifier and Type | Method | Description |
---|---|---|
int |
getSoTimeout() |
Get the SO_TIMEOUT.
|
boolean |
isRunning() |
Is the server running.
|
void |
start() |
Start the server.
|
void |
stop() |
Stop the server.
|
protected java.util.concurrent.ExecutorService executorService
protected cloud.piranha.api.HttpServerProcessor processor
protected int serverPort
protected java.lang.Thread serverAcceptorThread
protected java.net.ServerSocket serverSocket
protected boolean serverStopRequest
protected int soTimeout
protected java.util.concurrent.ThreadFactory threadFactory
public DefaultHttpServer()
public DefaultHttpServer(int serverPort, cloud.piranha.api.HttpServerProcessor processor)
serverPort
- the server port.processor
- the HTTP server processor.public DefaultHttpServer(int serverPort, cloud.piranha.api.HttpServerProcessor processor, int soTimeout)
serverPort
- the server port.processor
- the HTTP server processor.soTimeout
- the SO_TIMEOUT.public int getSoTimeout()
public boolean isRunning()
isRunning
in interface cloud.piranha.api.HttpServer
public void start()
start
in interface cloud.piranha.api.HttpServer
public void stop()
stop
in interface cloud.piranha.api.HttpServer
Copyright © 2020 Piranha Cloud. All rights reserved.