Package io.dropwizard.core.setup
Class Environment
java.lang.Object
io.dropwizard.core.setup.Environment
A Dropwizard application's environment.
-
Constructor Summary
ConstructorsConstructorDescriptionEnvironment(String name) Creates an environment with the system classloader, default object mapper, default validator factory, default health check registry, and default configuration for tests.Environment(String name, com.fasterxml.jackson.databind.ObjectMapper objectMapper, jakarta.validation.ValidatorFactory validatorFactory, com.codahale.metrics.MetricRegistry metricRegistry, @Nullable ClassLoader classLoader, com.codahale.metrics.health.HealthCheckRegistry healthCheckRegistry, Configuration configuration) Creates a new environment. -
Method Summary
Modifier and TypeMethodDescriptionadmin()Returns the application'sAdminEnvironment.io.dropwizard.jetty.MutableServletContextHandlerio.dropwizard.jetty.MutableServletContextHandlerReturns anExecutorServiceto run time bound health checks@Nullable jakarta.servlet.ServletgetName()Returns the application's name.com.fasterxml.jackson.databind.ObjectMapperReturns the application'sObjectMapper.jakarta.validation.ValidatorReturns the application'sValidator.io.dropwizard.health.HealthEnvironmenthealth()Returns the application'sHealthEnvironment.com.codahale.metrics.health.HealthCheckRegistryReturns the application'sHealthCheckRegistry.io.dropwizard.jersey.setup.JerseyEnvironmentjersey()Returns the application'sJerseyEnvironment.io.dropwizard.lifecycle.setup.LifecycleEnvironmentReturns the application'sLifecycleEnvironment.com.codahale.metrics.MetricRegistrymetrics()Returns the application'sMetricRegistry.io.dropwizard.jetty.setup.ServletEnvironmentservlets()Returns the application'sServletEnvironment.voidsetValidator(jakarta.validation.Validator validator) Sets the application'sValidator.
-
Constructor Details
-
Environment
public Environment(String name, com.fasterxml.jackson.databind.ObjectMapper objectMapper, jakarta.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 applicationobjectMapper- theObjectMapperfor the application
-
Environment
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 Details
-
jersey
public io.dropwizard.jersey.setup.JerseyEnvironment jersey()Returns the application'sJerseyEnvironment. -
getHealthCheckExecutorService
Returns anExecutorServiceto run time bound health checks -
admin
Returns the application'sAdminEnvironment. -
lifecycle
public io.dropwizard.lifecycle.setup.LifecycleEnvironment lifecycle()Returns the application'sLifecycleEnvironment. -
servlets
public io.dropwizard.jetty.setup.ServletEnvironment servlets()Returns the application'sServletEnvironment. -
health
public io.dropwizard.health.HealthEnvironment health()Returns the application'sHealthEnvironment. -
getObjectMapper
public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()Returns the application'sObjectMapper. -
getName
Returns the application's name. -
getValidator
public jakarta.validation.Validator getValidator()Returns the application'sValidator. -
setValidator
public void setValidator(jakarta.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 io.dropwizard.jetty.MutableServletContextHandler getApplicationContext() -
getJerseyServletContainer
public @Nullable jakarta.servlet.Servlet getJerseyServletContainer() -
getAdminContext
public io.dropwizard.jetty.MutableServletContextHandler getAdminContext()
-