public class HttpServer extends Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
HttpServer.Status |
Modifier and Type | Field and Description |
---|---|
private HttpConnectionFactory<? extends DefaultBHttpServerConnection> |
connectionFactory |
private ExceptionLogger |
exceptionLogger |
private HttpService |
httpService |
private InetAddress |
ifAddress |
private ThreadPoolExecutor |
listenerExecutorService |
private int |
port |
private RequestListener |
requestListener |
private ServerSocket |
serverSocket |
private ServerSocketFactory |
serverSocketFactory |
private SocketConfig |
socketConfig |
private SSLServerSetupHandler |
sslSetupHandler |
private AtomicReference<HttpServer.Status> |
status |
private WorkerPoolExecutor |
workerExecutorService |
private ThreadGroup |
workerThreads |
Constructor and Description |
---|
HttpServer(int port,
InetAddress ifAddress,
SocketConfig socketConfig,
ServerSocketFactory serverSocketFactory,
HttpService httpService,
HttpConnectionFactory<? extends DefaultBHttpServerConnection> connectionFactory,
SSLServerSetupHandler sslSetupHandler,
ExceptionLogger exceptionLogger) |
Modifier and Type | Method and Description |
---|---|
void |
awaitTermination(long timeout,
TimeUnit timeUnit) |
InetAddress |
getInetAddress() |
int |
getLocalPort() |
void |
shutdown(long gracePeriod,
TimeUnit timeUnit) |
void |
start() |
void |
stop() |
private final int port
private final InetAddress ifAddress
private final SocketConfig socketConfig
private final ServerSocketFactory serverSocketFactory
private final HttpService httpService
private final HttpConnectionFactory<? extends DefaultBHttpServerConnection> connectionFactory
private final SSLServerSetupHandler sslSetupHandler
private final ExceptionLogger exceptionLogger
private final ThreadPoolExecutor listenerExecutorService
private final ThreadGroup workerThreads
private final WorkerPoolExecutor workerExecutorService
private final AtomicReference<HttpServer.Status> status
private volatile ServerSocket serverSocket
private volatile RequestListener requestListener
HttpServer(int port, InetAddress ifAddress, SocketConfig socketConfig, ServerSocketFactory serverSocketFactory, HttpService httpService, HttpConnectionFactory<? extends DefaultBHttpServerConnection> connectionFactory, SSLServerSetupHandler sslSetupHandler, ExceptionLogger exceptionLogger)
public InetAddress getInetAddress()
public int getLocalPort()
public void start() throws IOException
IOException
public void stop()
public void awaitTermination(long timeout, TimeUnit timeUnit) throws InterruptedException
InterruptedException
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses