public class HttpServer
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
HttpServer.Status |
Modifier and Type | Field and Description |
---|---|
private NHttpConnectionFactory<? extends DefaultNHttpServerConnection> |
connectionFactory |
private java.lang.ThreadGroup |
dispatchThreads |
private ListenerEndpoint |
endpoint |
private ExceptionLogger |
exceptionLogger |
private java.net.InetAddress |
ifAddress |
private DefaultListeningIOReactor |
ioReactor |
private IOReactorConfig |
ioReactorConfig |
private java.util.concurrent.ExecutorService |
listenerExecutorService |
private int |
port |
private NHttpServerEventHandler |
serverEventHandler |
private java.util.concurrent.atomic.AtomicReference<HttpServer.Status> |
status |
Constructor and Description |
---|
HttpServer(int port,
java.net.InetAddress ifAddress,
IOReactorConfig ioReactorConfig,
NHttpServerEventHandler serverEventHandler,
NHttpConnectionFactory<? extends DefaultNHttpServerConnection> connectionFactory,
ExceptionLogger exceptionLogger) |
Modifier and Type | Method and Description |
---|---|
void |
awaitTermination(long timeout,
java.util.concurrent.TimeUnit timeUnit) |
ListenerEndpoint |
getEndpoint() |
void |
shutdown(long gracePeriod,
java.util.concurrent.TimeUnit timeUnit) |
void |
start() |
private final int port
private final java.net.InetAddress ifAddress
private final IOReactorConfig ioReactorConfig
private final NHttpServerEventHandler serverEventHandler
private final NHttpConnectionFactory<? extends DefaultNHttpServerConnection> connectionFactory
private final ExceptionLogger exceptionLogger
private final java.util.concurrent.ExecutorService listenerExecutorService
private final java.lang.ThreadGroup dispatchThreads
private final java.util.concurrent.atomic.AtomicReference<HttpServer.Status> status
private final DefaultListeningIOReactor ioReactor
private volatile ListenerEndpoint endpoint
HttpServer(int port, java.net.InetAddress ifAddress, IOReactorConfig ioReactorConfig, NHttpServerEventHandler serverEventHandler, NHttpConnectionFactory<? extends DefaultNHttpServerConnection> connectionFactory, ExceptionLogger exceptionLogger)
public ListenerEndpoint getEndpoint()
public void start() throws java.io.IOException
java.io.IOException
public void awaitTermination(long timeout, java.util.concurrent.TimeUnit timeUnit) throws java.lang.InterruptedException
java.lang.InterruptedException
public void shutdown(long gracePeriod, java.util.concurrent.TimeUnit timeUnit)