Class HttpServer
- java.lang.Object
-
- org.apache.http.impl.nio.bootstrap.HttpServer
-
public class HttpServer extends java.lang.Object- Since:
- 4.4
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classHttpServer.Status
-
Field Summary
Fields Modifier and Type Field Description private NHttpConnectionFactory<? extends DefaultNHttpServerConnection>connectionFactoryprivate java.lang.ThreadGroupdispatchThreadsprivate ListenerEndpointendpointprivate ExceptionLoggerexceptionLoggerprivate java.net.InetAddressifAddressprivate DefaultListeningIOReactorioReactorprivate IOReactorConfigioReactorConfigprivate java.util.concurrent.ExecutorServicelistenerExecutorServiceprivate intportprivate NHttpServerEventHandlerserverEventHandlerprivate java.util.concurrent.atomic.AtomicReference<HttpServer.Status>status
-
Constructor Summary
Constructors Constructor Description HttpServer(int port, java.net.InetAddress ifAddress, IOReactorConfig ioReactorConfig, NHttpServerEventHandler serverEventHandler, NHttpConnectionFactory<? extends DefaultNHttpServerConnection> connectionFactory, ExceptionLogger exceptionLogger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidawaitTermination(long timeout, java.util.concurrent.TimeUnit timeUnit)ListenerEndpointgetEndpoint()voidshutdown(long gracePeriod, java.util.concurrent.TimeUnit timeUnit)voidstart()
-
-
-
Field Detail
-
port
private final int port
-
ifAddress
private final java.net.InetAddress ifAddress
-
ioReactorConfig
private final IOReactorConfig ioReactorConfig
-
serverEventHandler
private final NHttpServerEventHandler serverEventHandler
-
connectionFactory
private final NHttpConnectionFactory<? extends DefaultNHttpServerConnection> connectionFactory
-
exceptionLogger
private final ExceptionLogger exceptionLogger
-
listenerExecutorService
private final java.util.concurrent.ExecutorService listenerExecutorService
-
dispatchThreads
private final java.lang.ThreadGroup dispatchThreads
-
status
private final java.util.concurrent.atomic.AtomicReference<HttpServer.Status> status
-
ioReactor
private final DefaultListeningIOReactor ioReactor
-
endpoint
private volatile ListenerEndpoint endpoint
-
-
Constructor Detail
-
HttpServer
HttpServer(int port, java.net.InetAddress ifAddress, IOReactorConfig ioReactorConfig, NHttpServerEventHandler serverEventHandler, NHttpConnectionFactory<? extends DefaultNHttpServerConnection> connectionFactory, ExceptionLogger exceptionLogger)
-
-
Method Detail
-
getEndpoint
public ListenerEndpoint getEndpoint()
-
start
public void start() throws java.io.IOException- Throws:
java.io.IOException
-
awaitTermination
public void awaitTermination(long timeout, java.util.concurrent.TimeUnit timeUnit) throws java.lang.InterruptedException- Throws:
java.lang.InterruptedException
-
shutdown
public void shutdown(long gracePeriod, java.util.concurrent.TimeUnit timeUnit)
-
-