Class HttpServer
- java.lang.Object
-
- org.apache.hc.core5.http.impl.bootstrap.HttpServer
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,ModalCloseable
public class HttpServer extends java.lang.Object implements ModalCloseable
HTTP/1.1 server side message exchange handler.- Since:
- 4.4
-
-
Constructor Summary
Constructors Constructor Description HttpServer(int port, HttpService httpService, java.net.InetAddress ifAddress, SocketConfig socketConfig, javax.net.ServerSocketFactory serverSocketFactory, HttpConnectionFactory<? extends DefaultBHttpServerConnection> connectionFactory, javax.net.ssl.SSLContext sslContext, Callback<javax.net.ssl.SSLParameters> sslSetupHandler, ExceptionListener exceptionListener)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidawaitTermination(TimeValue waitTime)voidclose()voidclose(CloseMode closeMode)Closes this process or endpoint and releases any system resources associated with it.voidclose(CloseMode closeMode, Timeout timeout)Closes this process or endpoint and releases any system resources associated with it.java.net.InetAddressgetInetAddress()intgetLocalPort()voidinitiateShutdown()voidstart()voidstop()
-
-
-
Constructor Detail
-
HttpServer
@Internal public HttpServer(int port, HttpService httpService, java.net.InetAddress ifAddress, SocketConfig socketConfig, javax.net.ServerSocketFactory serverSocketFactory, HttpConnectionFactory<? extends DefaultBHttpServerConnection> connectionFactory, javax.net.ssl.SSLContext sslContext, Callback<javax.net.ssl.SSLParameters> sslSetupHandler, ExceptionListener exceptionListener)
-
-
Method Detail
-
getInetAddress
public java.net.InetAddress getInetAddress()
-
getLocalPort
public int getLocalPort()
-
start
public void start() throws java.io.IOException- Throws:
java.io.IOException
-
stop
public void stop()
-
initiateShutdown
public void initiateShutdown()
-
awaitTermination
public void awaitTermination(TimeValue waitTime) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
close
public void close(CloseMode closeMode)
Description copied from interface:ModalCloseableCloses 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:
closein interfaceModalCloseable- 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:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
-