public abstract class AbstractServerFactory extends Object implements ServerFactory
ServerFactory
implementations.
Configuration Parameters:
Name | Default | Description |
requestLog |
The request log configuration. |
|
gzip |
The GZIP configuration. |
|
serverPush |
The ServerPushFilterFactory configuration. |
|
maxThreads |
1024 | The maximum number of threads to use for requests. |
minThreads |
8 | The minimum number of threads to use for requests. |
maxQueuedRequests |
1024 | The maximum number of requests to queue before blocking the acceptors. |
idleThreadTimeout |
1 minute | The amount of time a worker thread can be idle before being stopped. |
nofileSoftLimit |
(none) |
The number of open file descriptors before a soft error is issued. Requires Jetty's
libsetuid.so on java.library.path .
|
nofileHardLimit |
(none) |
The number of open file descriptors before a hard error is issued. Requires Jetty's
libsetuid.so on java.library.path .
|
gid |
(none) |
The group ID to switch to once the connectors have started. Requires Jetty's
libsetuid.so on java.library.path .
|
uid |
(none) |
The user ID to switch to once the connectors have started. Requires Jetty's
libsetuid.so on java.library.path .
|
user |
(none) |
The username to switch to once the connectors have started. Requires Jetty's
libsetuid.so on java.library.path .
|
group |
(none) |
The group to switch to once the connectors have started. Requires Jetty's
libsetuid.so on java.library.path .
|
umask |
(none) |
The umask to switch to once the connectors have started. Requires Jetty's
libsetuid.so on java.library.path .
|
startsAsRoot |
(none) |
Whether or not the Dropwizard application is started as a root user. Requires
Jetty's libsetuid.so on java.library.path .
|
registerDefaultExceptionMappers |
true | Whether or not the default Jersey ExceptionMappers should be registered. Set this to false if you want to register your own. |
shutdownGracePeriod |
30 seconds | The maximum time to wait for Jetty, and all Managed instances, to cleanly shutdown before forcibly terminating them. |
allowedMethods |
GET, POST, PUT, DELETE, HEAD, OPTIONS, PATCH | The set of allowed HTTP methods. Others will be rejected with a 405 Method Not Allowed response. |
rootPath |
/* |
The URL pattern relative to applicationContextPath from which the JAX-RS resources will be served.
|
DefaultServerFactory
,
SimpleServerFactory
Constructor and Description |
---|
AbstractServerFactory() |
Modifier and Type | Method and Description |
---|---|
protected org.eclipse.jetty.server.Handler |
addRequestLog(org.eclipse.jetty.server.Server server,
org.eclipse.jetty.server.Handler handler,
String name) |
protected org.eclipse.jetty.server.Handler |
addStatsHandler(org.eclipse.jetty.server.Handler handler) |
protected org.eclipse.jetty.server.Handler |
buildGzipHandler(org.eclipse.jetty.server.Handler handler) |
protected org.eclipse.jetty.server.Server |
buildServer(LifecycleEnvironment lifecycle,
org.eclipse.jetty.util.thread.ThreadPool threadPool) |
protected org.eclipse.jetty.setuid.SetUIDListener |
buildSetUIDListener() |
protected org.eclipse.jetty.server.Handler |
createAdminServlet(org.eclipse.jetty.server.Server server,
MutableServletContextHandler handler,
com.codahale.metrics.MetricRegistry metrics,
com.codahale.metrics.health.HealthCheckRegistry healthChecks) |
protected org.eclipse.jetty.server.Handler |
createAppServlet(org.eclipse.jetty.server.Server server,
JerseyEnvironment jersey,
com.fasterxml.jackson.databind.ObjectMapper objectMapper,
javax.validation.Validator validator,
MutableServletContextHandler handler,
javax.servlet.Servlet jerseyContainer,
com.codahale.metrics.MetricRegistry metricRegistry) |
protected org.eclipse.jetty.util.thread.ThreadPool |
createThreadPool(com.codahale.metrics.MetricRegistry metricRegistry) |
Set<String> |
getAllowedMethods() |
Integer |
getGid() |
String |
getGroup() |
GzipHandlerFactory |
getGzipFilterFactory() |
Duration |
getIdleThreadTimeout() |
Optional<String> |
getJerseyRootPath() |
int |
getMaxQueuedRequests() |
int |
getMaxThreads() |
int |
getMinThreads() |
Integer |
getNofileHardLimit() |
Integer |
getNofileSoftLimit() |
Boolean |
getRegisterDefaultExceptionMappers() |
RequestLogFactory |
getRequestLogFactory() |
ServerPushFilterFactory |
getServerPush() |
Duration |
getShutdownGracePeriod() |
Boolean |
getStartsAsRoot() |
Integer |
getUid() |
String |
getUmask() |
String |
getUser() |
boolean |
isThreadPoolSizedCorrectly() |
protected void |
printBanner(String name) |
void |
setAllowedMethods(Set<String> allowedMethods) |
void |
setGid(Integer gid) |
void |
setGroup(String group) |
void |
setGzipFilterFactory(GzipHandlerFactory gzip) |
void |
setIdleThreadTimeout(Duration idleThreadTimeout) |
void |
setJerseyRootPath(String jerseyRootPath) |
void |
setMaxQueuedRequests(int maxQueuedRequests) |
void |
setMaxThreads(int count) |
void |
setMinThreads(int count) |
void |
setNofileHardLimit(Integer nofileHardLimit) |
void |
setNofileSoftLimit(Integer nofileSoftLimit) |
void |
setRegisterDefaultExceptionMappers(Boolean registerDefaultExceptionMappers) |
void |
setRequestLogFactory(RequestLogFactory requestLog) |
void |
setServerPush(ServerPushFilterFactory serverPush) |
void |
setShutdownGracePeriod(Duration shutdownGracePeriod) |
void |
setStartsAsRoot(Boolean startsAsRoot) |
void |
setUid(Integer uid) |
void |
setUmask(String umask) |
void |
setUser(String user) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
build, configure
@ValidationMethod(message="must have a smaller minThreads than maxThreads") public boolean isThreadPoolSizedCorrectly()
public RequestLogFactory getRequestLogFactory()
public void setRequestLogFactory(RequestLogFactory requestLog)
public GzipHandlerFactory getGzipFilterFactory()
public void setGzipFilterFactory(GzipHandlerFactory gzip)
public ServerPushFilterFactory getServerPush()
public void setServerPush(ServerPushFilterFactory serverPush)
public int getMaxThreads()
public void setMaxThreads(int count)
public int getMinThreads()
public void setMinThreads(int count)
public int getMaxQueuedRequests()
public void setMaxQueuedRequests(int maxQueuedRequests)
public Duration getIdleThreadTimeout()
public void setIdleThreadTimeout(Duration idleThreadTimeout)
public Integer getNofileSoftLimit()
public void setNofileSoftLimit(Integer nofileSoftLimit)
public Integer getNofileHardLimit()
public void setNofileHardLimit(Integer nofileHardLimit)
public Integer getGid()
public void setGid(Integer gid)
public Integer getUid()
public void setUid(Integer uid)
public String getUser()
public void setUser(String user)
public String getGroup()
public void setGroup(String group)
public String getUmask()
public void setUmask(String umask)
public Boolean getStartsAsRoot()
public void setStartsAsRoot(Boolean startsAsRoot)
public Boolean getRegisterDefaultExceptionMappers()
public void setRegisterDefaultExceptionMappers(Boolean registerDefaultExceptionMappers)
public Duration getShutdownGracePeriod()
public void setShutdownGracePeriod(Duration shutdownGracePeriod)
public void setJerseyRootPath(String jerseyRootPath)
protected org.eclipse.jetty.server.Handler createAdminServlet(org.eclipse.jetty.server.Server server, MutableServletContextHandler handler, com.codahale.metrics.MetricRegistry metrics, com.codahale.metrics.health.HealthCheckRegistry healthChecks)
protected org.eclipse.jetty.server.Handler createAppServlet(org.eclipse.jetty.server.Server server, JerseyEnvironment jersey, com.fasterxml.jackson.databind.ObjectMapper objectMapper, javax.validation.Validator validator, MutableServletContextHandler handler, @Nullable javax.servlet.Servlet jerseyContainer, com.codahale.metrics.MetricRegistry metricRegistry)
protected org.eclipse.jetty.util.thread.ThreadPool createThreadPool(com.codahale.metrics.MetricRegistry metricRegistry)
protected org.eclipse.jetty.server.Server buildServer(LifecycleEnvironment lifecycle, org.eclipse.jetty.util.thread.ThreadPool threadPool)
protected org.eclipse.jetty.setuid.SetUIDListener buildSetUIDListener()
protected org.eclipse.jetty.server.Handler addRequestLog(org.eclipse.jetty.server.Server server, org.eclipse.jetty.server.Handler handler, String name)
protected org.eclipse.jetty.server.Handler addStatsHandler(org.eclipse.jetty.server.Handler handler)
protected org.eclipse.jetty.server.Handler buildGzipHandler(org.eclipse.jetty.server.Handler handler)
protected void printBanner(String name)
Copyright © 2016. All rights reserved.