Package io.dropwizard.server
Class SimpleServerFactory
- java.lang.Object
-
- io.dropwizard.server.AbstractServerFactory
-
- io.dropwizard.server.SimpleServerFactory
-
- All Implemented Interfaces:
Discoverable,ServerFactory
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:
For more configuration parameters, seeName Default Description connectorAn HTTP connectorlistening on port8080.The connectorwhich will handle both application and admin requests.applicationContextPath/applicationThe context path of the application servlets, including Jersey. adminContextPath/adminThe 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.Serverbuild(Environment environment)Build a server for the given Dropwizard application.voidconfigure(Environment environment)Configures the given environment with settings defined in the factory.StringgetAdminContextPath()StringgetApplicationContextPath()ConnectorFactorygetConnector()voidsetAdminContextPath(String contextPath)voidsetApplicationContextPath(String contextPath)voidsetConnector(ConnectorFactory factory)-
Methods inherited from class io.dropwizard.server.AbstractServerFactory
addRequestLog, addStatsHandler, buildGzipHandler, buildServer, buildSetUIDListener, createAdminServlet, createAppServlet, createThreadPool, getAllowedMethods, getDetailedJsonProcessingExceptionMapper, getDumpAfterStart, getDumpBeforeStop, getEnableThreadNameFilter, getGid, getGroup, getGzipFilterFactory, getIdleThreadTimeout, getJerseyRootPath, getMaxQueuedRequests, getMaxThreads, getMinThreads, getNofileHardLimit, getNofileSoftLimit, getRegisterDefaultExceptionMappers, getRequestLogFactory, 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:ServerFactoryBuild a server for the given Dropwizard application.- Parameters:
environment- the application's environment- Returns:
- a
Serverrunning the Dropwizard application
-
configure
public void configure(Environment environment)
Description copied from interface:ServerFactoryConfigures the given environment with settings defined in the factory.- Parameters:
environment- the application's environment
-
-