public class Environment extends Object
Constructor and Description |
---|
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.
|
Environment(String name,
com.fasterxml.jackson.databind.ObjectMapper objectMapper,
javax.validation.ValidatorFactory validatorFactory,
com.codahale.metrics.MetricRegistry metricRegistry,
ClassLoader classLoader,
com.codahale.metrics.health.HealthCheckRegistry healthCheckRegistry,
Configuration configuration)
Creates a new environment.
|
Modifier and Type | Method and Description |
---|---|
AdminEnvironment |
admin()
Returns the application's
AdminEnvironment . |
MutableServletContextHandler |
getAdminContext() |
MutableServletContextHandler |
getApplicationContext() |
ExecutorService |
getHealthCheckExecutorService()
Returns an
ExecutorService to run time bound health checks |
javax.servlet.Servlet |
getJerseyServletContainer() |
String |
getName()
Returns the application's name.
|
com.fasterxml.jackson.databind.ObjectMapper |
getObjectMapper()
Returns the application's
ObjectMapper . |
javax.validation.Validator |
getValidator()
Returns the application's
Validator . |
com.codahale.metrics.health.HealthCheckRegistry |
healthChecks()
Returns the application's
HealthCheckRegistry . |
JerseyEnvironment |
jersey()
Returns the application's
JerseyEnvironment . |
LifecycleEnvironment |
lifecycle()
Returns the application's
LifecycleEnvironment . |
com.codahale.metrics.MetricRegistry |
metrics()
Returns the application's
MetricRegistry . |
ServletEnvironment |
servlets()
Returns the application's
ServletEnvironment . |
void |
setValidator(javax.validation.Validator validator)
Sets the application's
Validator . |
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)
name
- the name of the applicationobjectMapper
- the ObjectMapper
for the applicationpublic Environment(String name)
public JerseyEnvironment jersey()
JerseyEnvironment
.public ExecutorService getHealthCheckExecutorService()
ExecutorService
to run time bound health checkspublic AdminEnvironment admin()
AdminEnvironment
.public LifecycleEnvironment lifecycle()
LifecycleEnvironment
.public ServletEnvironment servlets()
ServletEnvironment
.public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
ObjectMapper
.public String getName()
public javax.validation.Validator getValidator()
Validator
.public void setValidator(javax.validation.Validator validator)
Validator
.public com.codahale.metrics.MetricRegistry metrics()
MetricRegistry
.public com.codahale.metrics.health.HealthCheckRegistry healthChecks()
HealthCheckRegistry
.public MutableServletContextHandler getApplicationContext()
@Nullable public javax.servlet.Servlet getJerseyServletContainer()
public MutableServletContextHandler getAdminContext()
Copyright © 2020. All rights reserved.