Class HttpTestServer
java.lang.Object
org.apache.hc.core5.testing.nio.AsyncServer
org.apache.hc.core5.testing.nio.HttpTestServer
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
H2TestServer, Http1TestServer
- Since:
- 5.4
-
Constructor Summary
ConstructorsConstructorDescriptionHttpTestServer(org.apache.hc.core5.reactor.IOReactorConfig ioReactorConfig, SSLContext sslContext, org.apache.hc.core5.reactor.ssl.SSLSessionInitializer sslSessionInitializer, org.apache.hc.core5.reactor.ssl.SSLSessionVerifier sslSessionVerifier) -
Method Summary
Modifier and TypeMethodDescriptionvoidawaitShutdown(org.apache.hc.core5.util.TimeValue waitTime) voidclose()voidconfigure(org.apache.hc.core5.function.Decorator<org.apache.hc.core5.http.nio.AsyncServerExchangeHandler> exchangeHandlerDecorator) voidconfigure(org.apache.hc.core5.http.protocol.HttpProcessor httpProcessor) protected voidexecute(org.apache.hc.core5.reactor.IOEventHandlerFactory ioEventHandlerFactory) org.apache.hc.core5.reactor.IOReactorStatusvoidvoidregister(String uriPattern, org.apache.hc.core5.function.Supplier<org.apache.hc.core5.http.nio.AsyncServerExchangeHandler> supplier) <T> voidregister(String uriPattern, org.apache.hc.core5.http.nio.AsyncServerRequestHandler<T> requestHandler) voidshutdown(org.apache.hc.core5.util.TimeValue graceTime) abstract InetSocketAddressstart()startExecution(org.apache.hc.core5.reactor.IOEventHandlerFactory handlerFactory) Methods inherited from class AsyncServer
getEndpoints, listen
-
Constructor Details
-
HttpTestServer
public HttpTestServer(org.apache.hc.core5.reactor.IOReactorConfig ioReactorConfig, SSLContext sslContext, org.apache.hc.core5.reactor.ssl.SSLSessionInitializer sslSessionInitializer, org.apache.hc.core5.reactor.ssl.SSLSessionVerifier sslSessionVerifier) throws IOException - Throws:
IOException
-
HttpTestServer
- Throws:
IOException
-
-
Method Details
-
start
- Throws:
Exception
-
register
public void register(String uriPattern, org.apache.hc.core5.function.Supplier<org.apache.hc.core5.http.nio.AsyncServerExchangeHandler> supplier) -
register
public <T> void register(String uriPattern, org.apache.hc.core5.http.nio.AsyncServerRequestHandler<T> requestHandler) -
configure
public void configure(org.apache.hc.core5.http.protocol.HttpProcessor httpProcessor) -
configure
public void configure(org.apache.hc.core5.function.Decorator<org.apache.hc.core5.http.nio.AsyncServerExchangeHandler> exchangeHandlerDecorator) -
startExecution
public InetSocketAddress startExecution(org.apache.hc.core5.reactor.IOEventHandlerFactory handlerFactory) throws Exception - Throws:
Exception
-
execute
protected void execute(org.apache.hc.core5.reactor.IOEventHandlerFactory ioEventHandlerFactory) throws IOException - Throws:
IOException
-
getStatus
public org.apache.hc.core5.reactor.IOReactorStatus getStatus() -
awaitShutdown
- Throws:
InterruptedException
-
initiateShutdown
public void initiateShutdown() -
shutdown
public void shutdown(org.apache.hc.core5.util.TimeValue graceTime) -
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-