@NoImplement
public interface HttpServer
| Modifier and Type | Method and Description |
|---|---|
RequestHandlerManager |
addRequestHandler(Collection<String> methods,
String path,
RequestHandler requestHandler)
Adds a
RequestHandler on the given path and for the given methods. |
RequestHandlerManager |
addRequestHandler(String path,
RequestHandler requestHandler)
Adds a
RequestHandler on the given path and for all methods. |
default WebSocketHandlerManager |
addWebSocketHandler(WebSocketHandler handler)
Adds a
WebSocketHandler |
default void |
disableTls()
Disable TLS dynamically.
|
void |
dispose()
Removes all secondary data to get rid of the server.
|
default void |
enableTls(org.mule.runtime.api.tls.TlsContextFactory tlsContextFactory)
Enable TLS dynamically on this server using the supplied TLS context factory
|
HttpConstants.Protocol |
getProtocol() |
ServerAddress |
getServerAddress() |
boolean |
isStopped() |
boolean |
isStopping() |
HttpServer |
start()
Binds the ServerSocket to the network interface and starts listening for requests.
|
HttpServer |
stop()
Unbinds the ServerSocket to the network interface and stops listening for requests.
|
HttpServer start() throws IOException
IOException - if there was a problem binding to the host and port specified.HttpServer stop()
Currently executing requests are not affected and may proceed normally until dispose() is called.
void dispose()
If there are any currently running requests, this method will block until either those requests are finished or a timeout elapses. The requests that were received but didn't start processing, will be finished returning a 503 status code.
ServerAddress getServerAddress()
HttpConstants.Protocol getProtocol()
boolean isStopping()
boolean isStopped()
default void enableTls(org.mule.runtime.api.tls.TlsContextFactory tlsContextFactory)
tlsContextFactory - The TLS context factory to be used when dynamically enabled TLS at this serverdefault void disableTls()
RequestHandlerManager addRequestHandler(Collection<String> methods, String path, RequestHandler requestHandler)
RequestHandler on the given path and for the given methods.methods - a list of methods to matchpath - the path to matchrequestHandler - the handler to execute upon a matching requestRequestHandlerManager for the handlerRequestHandlerManager addRequestHandler(String path, RequestHandler requestHandler)
RequestHandler on the given path and for all methods.path - the path to matchrequestHandler - the handler to execute upon a matching requestRequestHandlerManager for the handlerdefault WebSocketHandlerManager addWebSocketHandler(WebSocketHandler handler)
WebSocketHandlerhandler - the handlerWebSocketHandlerManagerCopyright © 2003–2024 MuleSoft, Inc.. All rights reserved.