io.dropwizard.jackson.Discoverable
, ServerFactory
DefaultServerFactory
, SimpleServerFactory
public abstract class AbstractServerFactory extends java.lang.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.
|
enableThreadNameFilter |
true |
Whether or not to apply the ThreadNameFilter that adjusts thread names to include the request
method and request URI.
|
DefaultServerFactory
,
SimpleServerFactory
Constructor | Description |
---|---|
AbstractServerFactory() |
Modifier and Type | Method | Description |
---|---|---|
protected org.eclipse.jetty.server.Handler |
addRequestLog(org.eclipse.jetty.server.Server server,
org.eclipse.jetty.server.Handler handler,
java.lang.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(io.dropwizard.lifecycle.setup.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,
io.dropwizard.jetty.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,
io.dropwizard.jersey.setup.JerseyEnvironment jersey,
com.fasterxml.jackson.databind.ObjectMapper objectMapper,
javax.validation.Validator validator,
io.dropwizard.jetty.MutableServletContextHandler handler,
javax.servlet.Servlet jerseyContainer,
com.codahale.metrics.MetricRegistry metricRegistry) |
|
protected org.eclipse.jetty.util.thread.ThreadPool |
createThreadPool(com.codahale.metrics.MetricRegistry metricRegistry) |
|
java.util.Set<java.lang.String> |
getAllowedMethods() |
|
java.lang.Boolean |
getDetailedJsonProcessingExceptionMapper() |
|
boolean |
getEnableThreadNameFilter() |
|
java.lang.Integer |
getGid() |
|
java.lang.String |
getGroup() |
|
io.dropwizard.jetty.GzipHandlerFactory |
getGzipFilterFactory() |
|
io.dropwizard.util.Duration |
getIdleThreadTimeout() |
|
java.util.Optional<java.lang.String> |
getJerseyRootPath() |
|
int |
getMaxQueuedRequests() |
|
int |
getMaxThreads() |
|
int |
getMinThreads() |
|
java.lang.Integer |
getNofileHardLimit() |
|
java.lang.Integer |
getNofileSoftLimit() |
|
java.lang.Boolean |
getRegisterDefaultExceptionMappers() |
|
RequestLogFactory |
getRequestLogFactory() |
|
io.dropwizard.jetty.ServerPushFilterFactory |
getServerPush() |
|
io.dropwizard.util.Duration |
getShutdownGracePeriod() |
|
java.lang.Boolean |
getStartsAsRoot() |
|
java.lang.Integer |
getUid() |
|
java.lang.String |
getUmask() |
|
java.lang.String |
getUser() |
|
boolean |
isThreadPoolSizedCorrectly() |
|
protected void |
printBanner(java.lang.String name) |
|
void |
setAllowedMethods(java.util.Set<java.lang.String> allowedMethods) |
|
void |
setDetailedJsonProcessingExceptionMapper(java.lang.Boolean detailedJsonProcessingExceptionMapper) |
|
void |
setEnableThreadNameFilter(boolean enableThreadNameFilter) |
|
void |
setGid(java.lang.Integer gid) |
|
void |
setGroup(java.lang.String group) |
|
void |
setGzipFilterFactory(io.dropwizard.jetty.GzipHandlerFactory gzip) |
|
void |
setIdleThreadTimeout(io.dropwizard.util.Duration idleThreadTimeout) |
|
void |
setJerseyRootPath(java.lang.String jerseyRootPath) |
|
void |
setMaxQueuedRequests(int maxQueuedRequests) |
|
void |
setMaxThreads(int count) |
|
void |
setMinThreads(int count) |
|
void |
setNofileHardLimit(java.lang.Integer nofileHardLimit) |
|
void |
setNofileSoftLimit(java.lang.Integer nofileSoftLimit) |
|
void |
setRegisterDefaultExceptionMappers(java.lang.Boolean registerDefaultExceptionMappers) |
|
void |
setRequestLogFactory(RequestLogFactory requestLog) |
|
void |
setServerPush(io.dropwizard.jetty.ServerPushFilterFactory serverPush) |
|
void |
setShutdownGracePeriod(io.dropwizard.util.Duration shutdownGracePeriod) |
|
void |
setStartsAsRoot(java.lang.Boolean startsAsRoot) |
|
void |
setUid(java.lang.Integer uid) |
|
void |
setUmask(java.lang.String umask) |
|
void |
setUser(java.lang.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 io.dropwizard.jetty.GzipHandlerFactory getGzipFilterFactory()
public void setGzipFilterFactory(io.dropwizard.jetty.GzipHandlerFactory gzip)
public io.dropwizard.jetty.ServerPushFilterFactory getServerPush()
public void setServerPush(io.dropwizard.jetty.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 io.dropwizard.util.Duration getIdleThreadTimeout()
public void setIdleThreadTimeout(io.dropwizard.util.Duration idleThreadTimeout)
@Nullable public java.lang.Integer getNofileSoftLimit()
public void setNofileSoftLimit(java.lang.Integer nofileSoftLimit)
@Nullable public java.lang.Integer getNofileHardLimit()
public void setNofileHardLimit(java.lang.Integer nofileHardLimit)
@Nullable public java.lang.Integer getGid()
public void setGid(java.lang.Integer gid)
@Nullable public java.lang.Integer getUid()
public void setUid(java.lang.Integer uid)
@Nullable public java.lang.String getUser()
public void setUser(java.lang.String user)
@Nullable public java.lang.String getGroup()
public void setGroup(java.lang.String group)
@Nullable public java.lang.String getUmask()
public void setUmask(java.lang.String umask)
@Nullable public java.lang.Boolean getStartsAsRoot()
public void setStartsAsRoot(java.lang.Boolean startsAsRoot)
public java.lang.Boolean getRegisterDefaultExceptionMappers()
public void setRegisterDefaultExceptionMappers(java.lang.Boolean registerDefaultExceptionMappers)
public java.lang.Boolean getDetailedJsonProcessingExceptionMapper()
public void setDetailedJsonProcessingExceptionMapper(java.lang.Boolean detailedJsonProcessingExceptionMapper)
public io.dropwizard.util.Duration getShutdownGracePeriod()
public void setShutdownGracePeriod(io.dropwizard.util.Duration shutdownGracePeriod)
public java.util.Set<java.lang.String> getAllowedMethods()
public void setAllowedMethods(java.util.Set<java.lang.String> allowedMethods)
public java.util.Optional<java.lang.String> getJerseyRootPath()
public void setJerseyRootPath(java.lang.String jerseyRootPath)
public boolean getEnableThreadNameFilter()
public void setEnableThreadNameFilter(boolean enableThreadNameFilter)
protected org.eclipse.jetty.server.Handler createAdminServlet(org.eclipse.jetty.server.Server server, io.dropwizard.jetty.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, io.dropwizard.jersey.setup.JerseyEnvironment jersey, com.fasterxml.jackson.databind.ObjectMapper objectMapper, javax.validation.Validator validator, io.dropwizard.jetty.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(io.dropwizard.lifecycle.setup.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, java.lang.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(java.lang.String name)
Copyright © 2018. All rights reserved.