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 of ServerFactory, 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 port 8080. 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.

For more configuration parameters, see AbstractServerFactory.

See Also:
  • Constructor Details

    • SimpleServerFactory

      public SimpleServerFactory()
  • Method Details

    • 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