public class Environment extends Object
Environment Name | Binary Class Reloading | Configuration Auto Refresh |
---|---|---|
DEV | Enabled | Disabled |
IDE | Enabled | Enabled |
UNIT_TEST | Disabled | Disabled |
SAMPLE | Disabled | Disabled |
TEST | Enabled | Disabled |
STAGE | Enabled | Disabled |
PROD | Enabled | Disabled |
Any of the above environments can be specified as your environment, with specifying the name as a constructor
argument to the Environment
. The name is case insensitive so "DEV", "dev", "Dev" and "dEv" all represent
the predefined dev environment. This environment doesn't require the properties as the system will use the
properties as per the above table in defining the UltraESB system behavior.
Custom user defined environments can also be used, which requires the specification of the properties associated with that custom configuration. One could also use a pre-defined environment and overwrite any properties in the spring configuration
Modifier and Type | Class and Description |
---|---|
static class |
Environment.NamedEnv
Represent the pre-defined named environments
|
Constructor and Description |
---|
Environment(String name)
Constructs an Environment with the given name, while there are pre-defined environments as described in the
header comment, you could build your custom environment too.
|
Modifier and Type | Method and Description |
---|---|
String |
getName()
Gets the name of the environment
|
boolean |
isBinaryClassReloadingEnabled()
Whether binary class reloading or class hot swapping is enabled at the runtime, so that invoking the method
add or update DeploymentUnit to add or update a configuration will use the re-loaded classes.
|
boolean |
isConfigAutoRefreshEnabled()
Whether on the fly configuration updating is enabled.
|
boolean |
isDeploymentUnitsEnabled()
Whether to load deployment units or not
|
boolean |
isOnTheFlyCompilationEnabled()
Checks the on the fly compilation status
|
boolean |
isTuned()
Whether the environment is tuned for performance
|
boolean |
isUnitTestMode()
Whether the server is started for a unit test
|
void |
setBinaryClassReloadingEnabled(boolean binaryClassReloadingEnabled)
Sets whether the binary class reloading or the class hot swapping is enabled at runtime, so that invoking the
method add or update DeploymentUnit to add or update a configuration will use the re-loaded classes.
|
void |
setConfigAutoRefreshEnabled(boolean configAutoRefreshEnabled)
Sets whether on the fly configuration updating is enabled.
|
void |
setDeploymentUnitsEnabled(boolean deploymentUnitsEnabled)
Sets whether the deployment units are enabled
|
void |
setOnTheFlyCompilationEnabled(boolean onTheFlyCompilationEnabled)
Sets the on the fly compilation status
|
void |
setTuned(boolean tuned)
Sets whether the environment is tuned or not
|
void |
setUnitTestMode(boolean unitTestMode)
Sets whether the server is running in a unit test mode or not
|
public Environment(String name)
name
- name of the environment, with pre-defined values for "dev", "test", "unit_test", "sample",
"stage" and "prod"public boolean isBinaryClassReloadingEnabled()
public void setBinaryClassReloadingEnabled(boolean binaryClassReloadingEnabled)
binaryClassReloadingEnabled
- true to enable hot swapping of classespublic boolean isConfigAutoRefreshEnabled()
** Note: Not recommended to be used in production environments
public void setConfigAutoRefreshEnabled(boolean configAutoRefreshEnabled)
** Note: Not recommended to be used in production environments
configAutoRefreshEnabled
- true to enable configuration auto refreshingpublic boolean isUnitTestMode()
public void setUnitTestMode(boolean unitTestMode)
unitTestMode
- whether server is running in unit test modepublic boolean isTuned()
public void setTuned(boolean tuned)
tuned
- whether the server should be tuned or notpublic boolean isDeploymentUnitsEnabled()
public void setDeploymentUnitsEnabled(boolean deploymentUnitsEnabled)
deploymentUnitsEnabled
- whether the deployment units are enabledpublic boolean isOnTheFlyCompilationEnabled()
public void setOnTheFlyCompilationEnabled(boolean onTheFlyCompilationEnabled)
onTheFlyCompilationEnabled
- the on the fly compilation status to be setpublic String getName()
Copyright © 2010–2016 AdroitLogic. All rights reserved.