Package cloud.piranha.http.impl
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 HTTP Server.
- Author:
- Manfred Riem (mriem@manorrock.com)
-
Field Summary
Fields Modifier and Type Field Description protected ExecutorServiceexecutorServiceStores the executor service.protected HttpServerProcessorprocessorStores the processor.protected ThreadserverAcceptorThreadStores the server acceptor thread.protected intserverPortStores the port we are listening on.protected ServerSocketserverSocketStores the server socket.protected booleanserverStopRequestStores the server stop request.protected intsoTimeoutStores the SO_TIMEOUT.protected booleansslStores the SSL flag.protected ThreadFactorythreadFactoryStores the thread factory. -
Constructor Summary
Constructors Constructor Description DefaultHttpServer()ConstructorDefaultHttpServer(int serverPort)Constructor.DefaultHttpServer(int serverPort, HttpServerProcessor processor, boolean ssl)ConstructorDefaultHttpServer(int serverPort, HttpServerProcessor processor, int soTimeout)Constructor -
Method Summary
Modifier and Type Method Description HttpServerProcessorgetHttpServerProcessor()intgetServerPort()intgetSoTimeout()Get the SO_TIMEOUT.booleangetSSL()booleanisRunning()voidsetHttpServerProcessor(HttpServerProcessor httpServerProcessor)voidsetServerPort(int serverPort)voidsetSSL(boolean ssl)voidstart()voidstop()
-
Field Details
-
executorService
Stores the executor service. -
processor
Stores the processor. -
serverPort
protected int serverPortStores the port we are listening on. -
serverAcceptorThread
Stores the server acceptor thread. -
serverSocket
Stores the server socket. -
serverStopRequest
protected boolean serverStopRequestStores the server stop request. -
soTimeout
protected int soTimeoutStores the SO_TIMEOUT. -
ssl
protected boolean sslStores the SSL flag. -
threadFactory
Stores the thread factory.
-
-
Constructor Details
-
DefaultHttpServer
public DefaultHttpServer()Constructor -
DefaultHttpServer
public DefaultHttpServer(int serverPort)Constructor.- Parameters:
serverPort- the server port.
-
DefaultHttpServer
Constructor- Parameters:
serverPort- the server port.processor- the HTTP server processor.ssl- the SSL flag.
-
DefaultHttpServer
Constructor- Parameters:
serverPort- the server port.processor- the HTTP server processor.soTimeout- the SO_TIMEOUT.
-
-
Method Details
-
getSoTimeout
public int getSoTimeout()Get the SO_TIMEOUT.- Returns:
- the SO_TIMEOUT.
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceHttpServer- See Also:
HttpServer.isRunning()
-
start
public void start()- Specified by:
startin interfaceHttpServer- See Also:
HttpServer.start()
-
stop
public void stop()- Specified by:
stopin interfaceHttpServer- See Also:
HttpServer.stop()
-
getServerPort
public int getServerPort()- Specified by:
getServerPortin interfaceHttpServer
-
setServerPort
public void setServerPort(int serverPort)- Specified by:
setServerPortin interfaceHttpServer
-
setSSL
public void setSSL(boolean ssl)- Specified by:
setSSLin interfaceHttpServer
-
getSSL
public boolean getSSL()- Specified by:
getSSLin interfaceHttpServer
-
setHttpServerProcessor
- Specified by:
setHttpServerProcessorin interfaceHttpServer
-
getHttpServerProcessor
- Specified by:
getHttpServerProcessorin interfaceHttpServer
-