Package spark.embeddedserver.jetty
Class EmbeddedJettyFactory
java.lang.Object
spark.embeddedserver.jetty.EmbeddedJettyFactory
- All Implemented Interfaces:
EmbeddedServerFactory
Creates instances of embedded jetty containers.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private final JettyServerFactory
private org.eclipse.jetty.util.thread.ThreadPool
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate
(Routes routeMatcher, StaticFilesConfiguration staticFilesConfiguration, ExceptionMapper exceptionMapper, boolean hasMultipleHandler) Creates an embedded server instance.withHttpOnly
(boolean httpOnly) withThreadPool
(org.eclipse.jetty.util.thread.ThreadPool threadPool) Sets optional thread pool for jetty server.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface spark.embeddedserver.EmbeddedServerFactory
create
-
Field Details
-
serverFactory
-
threadPool
private org.eclipse.jetty.util.thread.ThreadPool threadPool -
httpOnly
private boolean httpOnly
-
-
Constructor Details
-
EmbeddedJettyFactory
public EmbeddedJettyFactory() -
EmbeddedJettyFactory
-
-
Method Details
-
create
public EmbeddedServer create(Routes routeMatcher, StaticFilesConfiguration staticFilesConfiguration, ExceptionMapper exceptionMapper, boolean hasMultipleHandler) Description copied from interface:EmbeddedServerFactory
Creates an embedded server instance.- Specified by:
create
in interfaceEmbeddedServerFactory
- Parameters:
routeMatcher
- The route matcherstaticFilesConfiguration
- The static files configuration objecthasMultipleHandler
- true if other handlers exist- Returns:
- the created instance
-
withThreadPool
Sets optional thread pool for jetty server. This is useful for overriding the default thread pool behaviour for example io.dropwizard.metrics.jetty9.InstrumentedQueuedThreadPool.- Parameters:
threadPool
- thread pool- Returns:
- Builder pattern - returns this instance
-
withHttpOnly
-