Package spark.embeddedserver.jetty
Class EmbeddedJettyFactory
- java.lang.Object
-
- spark.embeddedserver.jetty.EmbeddedJettyFactory
-
- All Implemented Interfaces:
EmbeddedServerFactory
public class EmbeddedJettyFactory extends java.lang.Object implements EmbeddedServerFactory
Creates instances of embedded jetty containers.
-
-
Field Summary
Fields Modifier and Type Field Description private booleanhttpOnlyprivate JettyServerFactoryserverFactoryprivate org.eclipse.jetty.util.thread.ThreadPoolthreadPool
-
Constructor Summary
Constructors Constructor Description EmbeddedJettyFactory()EmbeddedJettyFactory(JettyServerFactory serverFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EmbeddedServercreate(Routes routeMatcher, StaticFilesConfiguration staticFilesConfiguration, ExceptionMapper exceptionMapper, boolean hasMultipleHandler)Creates an embedded server instance.EmbeddedJettyFactorywithHttpOnly(boolean httpOnly)EmbeddedJettyFactorywithThreadPool(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 Detail
-
serverFactory
private final JettyServerFactory serverFactory
-
threadPool
private org.eclipse.jetty.util.thread.ThreadPool threadPool
-
httpOnly
private boolean httpOnly
-
-
Constructor Detail
-
EmbeddedJettyFactory
public EmbeddedJettyFactory()
-
EmbeddedJettyFactory
public EmbeddedJettyFactory(JettyServerFactory serverFactory)
-
-
Method Detail
-
create
public EmbeddedServer create(Routes routeMatcher, StaticFilesConfiguration staticFilesConfiguration, ExceptionMapper exceptionMapper, boolean hasMultipleHandler)
Description copied from interface:EmbeddedServerFactoryCreates an embedded server instance.- Specified by:
createin interfaceEmbeddedServerFactory- Parameters:
routeMatcher- The route matcherstaticFilesConfiguration- The static files configuration objecthasMultipleHandler- true if other handlers exist- Returns:
- the created instance
-
withThreadPool
public EmbeddedJettyFactory withThreadPool(org.eclipse.jetty.util.thread.ThreadPool threadPool)
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
public EmbeddedJettyFactory withHttpOnly(boolean httpOnly)
-
-