public class EnvironmentDetectorSpringProfileImpl extends AbstractEnvironmentDetector
EnvironmentDetector
. It is based on spring
profiles.Modifier and Type | Field and Description |
---|---|
private org.springframework.core.env.Environment |
environment
The
Environment used to determine if we are running in production. |
private String |
environmentType |
ENVIRONMENT_TYPE_ACCEPTANCE, ENVIRONMENT_TYPE_DEVELOPMENT, ENVIRONMENT_TYPE_PRE_PRODUCTION, ENVIRONMENT_TYPE_PRODUCTION, ENVIRONMENT_TYPE_STAGING, ENVIRONMENT_TYPE_TEST
Constructor and Description |
---|
EnvironmentDetectorSpringProfileImpl()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
protected String |
detectEnvironmentType(String name) |
protected String |
detectEnvironmentType(String[] names) |
protected void |
doInitialize()
This method performs the actual
initialization . |
org.springframework.core.env.Environment |
getEnvironment() |
String |
getEnvironmentType() |
protected String |
getEnvironmentTypeSynchronized() |
protected void |
logEnvironmentStatus()
Logs the current environment status information.
|
void |
setEnvironment(org.springframework.core.env.Environment environment) |
isDevelopmentEnvironment, isEnvironmentCloseToProduction, isProductionEnvironment
createLogger, getLogger
doInitialized, getInitializationState, initialize
@Inject private org.springframework.core.env.Environment environment
Environment
used to determine if we are running in production.private String environmentType
public EnvironmentDetectorSpringProfileImpl()
public String getEnvironmentType()
EnvironmentDetector.ENVIRONMENT_TYPE_DEVELOPMENT
, EnvironmentDetector.ENVIRONMENT_TYPE_TEST
,
EnvironmentDetector.ENVIRONMENT_TYPE_ACCEPTANCE
, EnvironmentDetector.ENVIRONMENT_TYPE_PRODUCTION
, or any other custom kind of
environment.protected String getEnvironmentTypeSynchronized()
environment type
with lazy initialization.public org.springframework.core.env.Environment getEnvironment()
Environment
.@Inject public void setEnvironment(org.springframework.core.env.Environment environment)
environment
- is the Environment
to Inject
.protected void doInitialize()
AbstractComponent
initialization
. It is called when AbstractComponent.initialize()
is
invoked for the first time. super.
AbstractComponent.doInitialize()
.doInitialize
in class AbstractLoggableComponent
protected void logEnvironmentStatus()
AbstractEnvironmentDetector
logEnvironmentStatus
in class AbstractEnvironmentDetector
protected String detectEnvironmentType(String[] names)
names
- are the names of actual environments or configuration profiles.protected String detectEnvironmentType(String name)
name
- is the name of an actual environment or a configuration profile.environment type
that has been detected by naming convention, or
null
if nothing could be detected.Copyright © 2001–2016 mmm-Team. All rights reserved.