Class Environment


  • public class Environment
    extends Object
    A Dropwizard application's environment.
    • Constructor Detail

      • Environment

        public Environment​(String name,
                           com.fasterxml.jackson.databind.ObjectMapper objectMapper,
                           javax.validation.ValidatorFactory validatorFactory,
                           com.codahale.metrics.MetricRegistry metricRegistry,
                           @Nullable ClassLoader classLoader,
                           com.codahale.metrics.health.HealthCheckRegistry healthCheckRegistry,
                           Configuration configuration)
        Creates a new environment.
        Parameters:
        name - the name of the application
        objectMapper - the ObjectMapper for the application
      • Environment

        public Environment​(String name)
        Creates an environment with the system classloader, default object mapper, default validator factory, default health check registry, and default configuration for tests.
        Since:
        2.0
    • Method Detail

      • getObjectMapper

        public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
        Returns the application's ObjectMapper.
      • getName

        public String getName()
        Returns the application's name.
      • getValidator

        public javax.validation.Validator getValidator()
        Returns the application's Validator.
      • setValidator

        public void setValidator​(javax.validation.Validator validator)
        Sets the application's Validator.
      • metrics

        public com.codahale.metrics.MetricRegistry metrics()
        Returns the application's MetricRegistry.
      • healthChecks

        public com.codahale.metrics.health.HealthCheckRegistry healthChecks()
        Returns the application's HealthCheckRegistry.
      • getJerseyServletContainer

        public @Nullable javax.servlet.Servlet getJerseyServletContainer()