public class EmbeddedJettyServer extends Object implements EmbeddedServer
Constructor and Description |
---|
EmbeddedJettyServer(JettyServerFactory serverFactory,
org.eclipse.jetty.server.Handler handler) |
Modifier and Type | Method and Description |
---|---|
int |
activeThreadCount() |
void |
configureWebSockets(Map<String,WebSocketHandlerWrapper> webSocketHandlers,
Optional<Long> webSocketIdleTimeoutMillis)
Configures the web sockets for the embedded server.
|
void |
extinguish()
Extinguish the embedded server.
|
int |
ignite(String host,
int port,
SslStores sslStores,
int maxThreads,
int minThreads,
int threadIdleTimeoutMillis)
Ignites the embedded server, listening on the specified port, running SSL secured with the specified keystore
and truststore.
|
void |
join()
Joins the embedded server thread(s).
|
void |
trustForwardHeaders(boolean trust)
Must be called before ignite()
Must be it's own default method to maintain backwards compatibility.
|
EmbeddedJettyServer |
withThreadPool(org.eclipse.jetty.util.thread.ThreadPool threadPool)
Sets optional thread pool for jetty server.
|
public EmbeddedJettyServer(JettyServerFactory serverFactory, org.eclipse.jetty.server.Handler handler)
public void configureWebSockets(Map<String,WebSocketHandlerWrapper> webSocketHandlers, Optional<Long> webSocketIdleTimeoutMillis)
EmbeddedServer
configureWebSockets
in interface EmbeddedServer
webSocketHandlers
- - web socket handlers.webSocketIdleTimeoutMillis
- - Optional WebSocket idle timeout (ms).public void trustForwardHeaders(boolean trust)
EmbeddedServer
trustForwardHeaders
in interface EmbeddedServer
public int ignite(String host, int port, SslStores sslStores, int maxThreads, int minThreads, int threadIdleTimeoutMillis) throws Exception
ignite
in interface EmbeddedServer
host
- The address to listen onport
- - the portsslStores
- - The SSL sslStores.maxThreads
- - max nbr of threads.minThreads
- - min nbr of threads.Exception
public void join() throws InterruptedException
join
in interface EmbeddedServer
InterruptedException
public void extinguish()
extinguish
in interface EmbeddedServer
public int activeThreadCount()
activeThreadCount
in interface EmbeddedServer
public EmbeddedJettyServer withThreadPool(org.eclipse.jetty.util.thread.ThreadPool threadPool)
threadPool
- thread poolCopyright © 2022. All rights reserved.