Package io.dropwizard.core.server
Class SimpleServerFactory
- java.lang.Object
-
- io.dropwizard.core.server.AbstractServerFactory
-
- io.dropwizard.core.server.SimpleServerFactory
-
- All Implemented Interfaces:
ServerFactory
,Discoverable
public class SimpleServerFactory extends AbstractServerFactory
A single-connector implementation ofServerFactory
, suitable for PaaS deployments (e.g., Heroku) where applications are limited to a single, runtime-defined port. A startup script can override the port via-Ddw.server.connector.port=$PORT
. Configuration Parameters:Name Default Description connector
An HTTP connector
listening on port8080
.The connector
which will handle both application and admin requests.applicationContextPath
/application
The context path of the application servlets, including Jersey. adminContextPath
/admin
The context path of the admin servlets, including metrics and tasks. AbstractServerFactory
.- See Also:
ServerFactory
,AbstractServerFactory
-
-
Constructor Summary
Constructors Constructor Description SimpleServerFactory()
-
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.String
getAdminContextPath()
String
getApplicationContextPath()
ConnectorFactory
getConnector()
void
setAdminContextPath(String contextPath)
void
setApplicationContextPath(String contextPath)
void
setConnector(ConnectorFactory factory)
-
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, isThreadPoolSizedCorrectly, printBanner, setAllowedMethods, setDetailedJsonProcessingExceptionMapper, setDumpAfterStart, setDumpBeforeStop, setEnableThreadNameFilter, setGid, setGroup, setGzipFilterFactory, setIdleThreadTimeout, setJerseyRootPath, setMaxQueuedRequests, setMaxThreads, setMinThreads, setNofileHardLimit, setNofileSoftLimit, setRegisterDefaultExceptionMappers, setRequestLogFactory, setServerPush, setShutdownGracePeriod, setStartsAsRoot, setUid, setUmask, setUser
-
-
-
-
Method Detail
-
getConnector
public ConnectorFactory getConnector()
-
setConnector
public void setConnector(ConnectorFactory factory)
-
getApplicationContextPath
public String getApplicationContextPath()
-
setApplicationContextPath
public void setApplicationContextPath(String contextPath)
-
getAdminContextPath
public String getAdminContextPath()
-
setAdminContextPath
public void setAdminContextPath(String contextPath)
-
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
-
-