Package io.dropwizard.core.server
Class DefaultServerFactory
- java.lang.Object
-
- io.dropwizard.core.server.AbstractServerFactory
-
- io.dropwizard.core.server.DefaultServerFactory
-
- All Implemented Interfaces:
ServerFactory
,Discoverable
public class DefaultServerFactory extends AbstractServerFactory
The default implementation ofServerFactory
, which allows for multiple sets of application and admin connectors, all running on separate ports. Admin connectors use a separate thread pool to keep the control and data planes separate(ish). Configuration Parameters:Name Default Description applicationConnectors
An HTTP connector
listening on port 8080.A set of connectors
which will handle application requests.adminConnectors
An HTTP connector
listening on port 8081.A set of connectors
which will handle admin requests.adminMaxThreads
64 The maximum number of threads to use for admin requests. adminMinThreads
1 The minimum number of threads to use for admin requests. enableAdminVirtualThreads
false Whether to use virtual threads for the admin connectors AbstractServerFactory
.- See Also:
ServerFactory
,AbstractServerFactory
-
-
Constructor Summary
Constructors Constructor Description DefaultServerFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.jetty.server.Server
build(Environment environment)
Build a server for the given Dropwizard application.void
configure(Environment environment)
Configures the given environment with settings defined in the factory.List<ConnectorFactory>
getAdminConnectors()
String
getAdminContextPath()
int
getAdminMaxThreads()
int
getAdminMinThreads()
List<ConnectorFactory>
getApplicationConnectors()
String
getApplicationContextPath()
boolean
isEnableAdminVirtualThreads()
void
setAdminConnectors(List<ConnectorFactory> connectors)
void
setAdminContextPath(String adminContextPath)
void
setAdminMaxThreads(int adminMaxThreads)
void
setAdminMinThreads(int adminMinThreads)
void
setApplicationConnectors(List<ConnectorFactory> connectors)
void
setApplicationContextPath(String applicationContextPath)
void
setEnableAdminVirtualThreads(boolean enableAdminVirtualThreads)
String
toString()
-
Methods inherited from class io.dropwizard.core.server.AbstractServerFactory
addRequestLog, addStatsHandler, buildGzipHandler, buildServer, buildSetUIDListener, createAdminServlet, createAppServlet, createThreadPool, getAllowedMethods, getDetailedJsonProcessingExceptionMapper, getDumpAfterStart, getDumpBeforeStop, getEnableThreadNameFilter, getGid, getGroup, getGzipFilterFactory, getIdleThreadTimeout, getJerseyRootPath, getMaxQueuedRequests, getMaxThreads, getMetricPrefix, getMinThreads, getNofileHardLimit, getNofileSoftLimit, getRegisterDefaultExceptionMappers, getRequestLogFactory, getResponseMeteredLevel, getServerPush, getShutdownGracePeriod, getStartsAsRoot, getUid, getUmask, getUser, getVirtualThreadsExecutorService, isEnableVirtualThreads, isThreadPoolSizedCorrectly, printBanner, setAllowedMethods, setDetailedJsonProcessingExceptionMapper, setDumpAfterStart, setDumpBeforeStop, setEnableThreadNameFilter, setEnableVirtualThreads, setGid, setGroup, setGzipFilterFactory, setIdleThreadTimeout, setJerseyRootPath, setMaxQueuedRequests, setMaxThreads, setMinThreads, setNofileHardLimit, setNofileSoftLimit, setRegisterDefaultExceptionMappers, setRequestLogFactory, setServerPush, setShutdownGracePeriod, setStartsAsRoot, setUid, setUmask, setUser
-
-
-
-
Method Detail
-
getApplicationConnectors
public List<ConnectorFactory> getApplicationConnectors()
-
setApplicationConnectors
public void setApplicationConnectors(List<ConnectorFactory> connectors)
-
getAdminConnectors
public List<ConnectorFactory> getAdminConnectors()
-
setAdminConnectors
public void setAdminConnectors(List<ConnectorFactory> connectors)
-
getAdminMaxThreads
public int getAdminMaxThreads()
-
setAdminMaxThreads
public void setAdminMaxThreads(int adminMaxThreads)
-
getAdminMinThreads
public int getAdminMinThreads()
-
setAdminMinThreads
public void setAdminMinThreads(int adminMinThreads)
-
isEnableAdminVirtualThreads
public boolean isEnableAdminVirtualThreads()
-
setEnableAdminVirtualThreads
public void setEnableAdminVirtualThreads(boolean enableAdminVirtualThreads)
-
getApplicationContextPath
public String getApplicationContextPath()
-
setApplicationContextPath
public void setApplicationContextPath(String applicationContextPath)
-
getAdminContextPath
public String getAdminContextPath()
-
setAdminContextPath
public void setAdminContextPath(String adminContextPath)
-
build
public org.eclipse.jetty.server.Server build(Environment environment)
Description copied from interface:ServerFactory
Build a server for the given Dropwizard application.- Parameters:
environment
- the application's environment- Returns:
- a
Server
running the Dropwizard application
-
configure
public void configure(Environment environment)
Description copied from interface:ServerFactory
Configures the given environment with settings defined in the factory.- Parameters:
environment
- the application's environment
-
-