Class HttpServerModule

All Implemented Interfaces:
com.google.inject.Module, ConfigurationAwareModule

public class HttpServerModule extends AbstractConfigurationAwareModule
Provides a fully configured instance of an HTTP server, ready to use with Guice.

Features:

  • HTTP/HTTPS
  • Basic Auth
  • Request logging
  • JMX
Configuration options are provided via HttpServerConfig

To enable JMX, an MBeanServer must be bound elsewhere

To enable Basic Auth, a LoginService must be bound elsewhere

To enable HTTPS, HttpServerConfig.isHttpsEnabled() must return true and HttpsConfig.getKeystorePath() and HttpsConfig.getKeystorePassword() must return the path to the keystore containing the SSL cert and the password to the keystore, respectively. The HTTPS port is specified via HttpsConfig.getHttpsPort().