Package io.dropwizard.setup
Class Environment
- java.lang.Object
-
- io.dropwizard.setup.Environment
-
public class Environment extends Object
A Dropwizard application's environment.
-
-
Constructor Summary
Constructors Constructor Description Environment(String name, com.fasterxml.jackson.databind.ObjectMapper objectMapper, javax.validation.Validator validator, com.codahale.metrics.MetricRegistry metricRegistry, ClassLoader classLoader)Creates an environment with default health check registryEnvironment(String name, com.fasterxml.jackson.databind.ObjectMapper objectMapper, javax.validation.Validator validator, com.codahale.metrics.MetricRegistry metricRegistry, ClassLoader classLoader, com.codahale.metrics.health.HealthCheckRegistry healthCheckRegistry)Creates a new environment.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AdminEnvironmentadmin()Returns the application'sAdminEnvironment.MutableServletContextHandlergetAdminContext()MutableServletContextHandlergetApplicationContext()ExecutorServicegetHealthCheckExecutorService()Returns anExecutorServiceto run time bound health checksjavax.servlet.ServletgetJerseyServletContainer()StringgetName()Returns the application's name.com.fasterxml.jackson.databind.ObjectMappergetObjectMapper()Returns the application'sObjectMapper.javax.validation.ValidatorgetValidator()Returns the application'sValidator.com.codahale.metrics.health.HealthCheckRegistryhealthChecks()Returns the application'sHealthCheckRegistry.JerseyEnvironmentjersey()Returns the application'sJerseyEnvironment.LifecycleEnvironmentlifecycle()Returns the application'sLifecycleEnvironment.com.codahale.metrics.MetricRegistrymetrics()Returns the application'sMetricRegistry.ServletEnvironmentservlets()Returns the application'sServletEnvironment.voidsetValidator(javax.validation.Validator validator)Sets the application'sValidator.
-
-
-
Constructor Detail
-
Environment
public Environment(String name, com.fasterxml.jackson.databind.ObjectMapper objectMapper, javax.validation.Validator validator, com.codahale.metrics.MetricRegistry metricRegistry, @Nullable ClassLoader classLoader, com.codahale.metrics.health.HealthCheckRegistry healthCheckRegistry)
Creates a new environment.- Parameters:
name- the name of the applicationobjectMapper- theObjectMapperfor the application
-
Environment
public Environment(String name, com.fasterxml.jackson.databind.ObjectMapper objectMapper, javax.validation.Validator validator, com.codahale.metrics.MetricRegistry metricRegistry, @Nullable ClassLoader classLoader)
Creates an environment with default health check registry
-
-
Method Detail
-
jersey
public JerseyEnvironment jersey()
Returns the application'sJerseyEnvironment.
-
getHealthCheckExecutorService
public ExecutorService getHealthCheckExecutorService()
Returns anExecutorServiceto run time bound health checks
-
admin
public AdminEnvironment admin()
Returns the application'sAdminEnvironment.
-
lifecycle
public LifecycleEnvironment lifecycle()
Returns the application'sLifecycleEnvironment.
-
servlets
public ServletEnvironment servlets()
Returns the application'sServletEnvironment.
-
getObjectMapper
public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
Returns the application'sObjectMapper.
-
getName
public String getName()
Returns the application's name.
-
getValidator
public javax.validation.Validator getValidator()
Returns the application'sValidator.
-
setValidator
public void setValidator(javax.validation.Validator validator)
Sets the application'sValidator.
-
metrics
public com.codahale.metrics.MetricRegistry metrics()
Returns the application'sMetricRegistry.
-
healthChecks
public com.codahale.metrics.health.HealthCheckRegistry healthChecks()
Returns the application'sHealthCheckRegistry.
-
getApplicationContext
public MutableServletContextHandler getApplicationContext()
-
getJerseyServletContainer
@Nullable public javax.servlet.Servlet getJerseyServletContainer()
-
getAdminContext
public MutableServletContextHandler getAdminContext()
-
-