Class JettyHttpServer
- java.lang.Object
-
- com.github.tomakehurst.wiremock.jetty.JettyHttpServer
-
- All Implemented Interfaces:
HttpServer
- Direct Known Subclasses:
Jetty11HttpServer
public abstract class JettyHttpServer extends java.lang.Object implements HttpServer
-
-
Field Summary
Fields Modifier and Type Field Description protected org.eclipse.jetty.server.ServerConnectorhttpConnectorprotected org.eclipse.jetty.server.ServerConnectorhttpsConnectorprotected org.eclipse.jetty.server.ServerjettyServerprotected java.util.concurrent.ScheduledExecutorServicescheduledExecutorService
-
Constructor Summary
Constructors Constructor Description JettyHttpServer(Options options, AdminRequestHandler adminRequestHandler, StubRequestHandler stubRequestHandler)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidapplyAdditionalServerConfiguration(org.eclipse.jetty.server.Server jettyServer, Options options)protected MultipartRequestConfigurerbuildMultipartRequestConfigurer()protected org.eclipse.jetty.server.handler.HandlerCollectioncreateHandler(Options options, AdminRequestHandler adminRequestHandler, StubRequestHandler stubRequestHandler)protected abstract org.eclipse.jetty.server.ServerConnectorcreateHttpConnector(java.lang.String bindAddress, int port, JettySettings jettySettings, org.eclipse.jetty.io.NetworkTrafficListener listener)protected abstract org.eclipse.jetty.server.ServerConnectorcreateHttpsConnector(java.lang.String bindAddress, HttpsSettings httpsSettings, JettySettings jettySettings, org.eclipse.jetty.io.NetworkTrafficListener listener)protected org.eclipse.jetty.server.ServercreateServer(Options options)protected voiddecorateAdminServiceContextAfterConfig(org.eclipse.jetty.servlet.ServletContextHandler adminServiceContext)protected voiddecorateAdminServiceContextBeforeConfig(org.eclipse.jetty.servlet.ServletContextHandler adminServiceContext)protected voiddecorateMockServiceContextAfterConfig(org.eclipse.jetty.servlet.ServletContextHandler mockServiceContext)protected voiddecorateMockServiceContextBeforeConfig(org.eclipse.jetty.servlet.ServletContextHandler mockServiceContext)protected org.eclipse.jetty.server.Handler[]extensionHandlers()Extend only this method if you want to add additional handlers to Jetty.protected voidfinalizeSetup(Options options)inthttpsPort()booleanisRunning()intport()voidstart()voidstop()longstopTimeout()
-
-
-
Field Detail
-
jettyServer
protected final org.eclipse.jetty.server.Server jettyServer
-
httpConnector
protected final org.eclipse.jetty.server.ServerConnector httpConnector
-
httpsConnector
protected final org.eclipse.jetty.server.ServerConnector httpsConnector
-
scheduledExecutorService
protected java.util.concurrent.ScheduledExecutorService scheduledExecutorService
-
-
Constructor Detail
-
JettyHttpServer
public JettyHttpServer(Options options, AdminRequestHandler adminRequestHandler, StubRequestHandler stubRequestHandler)
-
-
Method Detail
-
applyAdditionalServerConfiguration
protected void applyAdditionalServerConfiguration(org.eclipse.jetty.server.Server jettyServer, Options options)
-
createHandler
protected org.eclipse.jetty.server.handler.HandlerCollection createHandler(Options options, AdminRequestHandler adminRequestHandler, StubRequestHandler stubRequestHandler)
-
finalizeSetup
protected void finalizeSetup(Options options)
-
createServer
protected org.eclipse.jetty.server.Server createServer(Options options)
-
extensionHandlers
protected org.eclipse.jetty.server.Handler[] extensionHandlers()
Extend only this method if you want to add additional handlers to Jetty.
-
start
public void start()
- Specified by:
startin interfaceHttpServer
-
stop
public void stop()
- Specified by:
stopin interfaceHttpServer
-
isRunning
public boolean isRunning()
- Specified by:
isRunningin interfaceHttpServer
-
port
public int port()
- Specified by:
portin interfaceHttpServer
-
httpsPort
public int httpsPort()
- Specified by:
httpsPortin interfaceHttpServer
-
stopTimeout
public long stopTimeout()
-
createHttpConnector
protected abstract org.eclipse.jetty.server.ServerConnector createHttpConnector(java.lang.String bindAddress, int port, JettySettings jettySettings, org.eclipse.jetty.io.NetworkTrafficListener listener)
-
createHttpsConnector
protected abstract org.eclipse.jetty.server.ServerConnector createHttpsConnector(java.lang.String bindAddress, HttpsSettings httpsSettings, JettySettings jettySettings, org.eclipse.jetty.io.NetworkTrafficListener listener)
-
decorateMockServiceContextBeforeConfig
protected void decorateMockServiceContextBeforeConfig(org.eclipse.jetty.servlet.ServletContextHandler mockServiceContext)
-
decorateMockServiceContextAfterConfig
protected void decorateMockServiceContextAfterConfig(org.eclipse.jetty.servlet.ServletContextHandler mockServiceContext)
-
decorateAdminServiceContextBeforeConfig
protected void decorateAdminServiceContextBeforeConfig(org.eclipse.jetty.servlet.ServletContextHandler adminServiceContext)
-
decorateAdminServiceContextAfterConfig
protected void decorateAdminServiceContextAfterConfig(org.eclipse.jetty.servlet.ServletContextHandler adminServiceContext)
-
buildMultipartRequestConfigurer
protected MultipartRequestConfigurer buildMultipartRequestConfigurer()
-
-