|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||
java.lang.Objectjava.lang.Enum<Environment>
grails.util.Environment
public enum Environment
An enum that represents the current environment
| Enum Constant Summary | |
|---|---|
APPLICATION
|
|
CUSTOM
|
|
DEVELOPMENT
|
|
PRODUCTION
|
|
TEST
|
|
| Field Summary | |
|---|---|
static String |
DEFAULT
Constants that indicates whether this GrailsApplication is running in the default environment |
static String |
KEY
Constant used to resolve the environment via System.getProperty(Environment.KEY) |
static String |
RELOAD_ENABLED
Specify whether reloading is enabled for this environment |
static String |
RELOAD_LOCATION
The location where to reload resources from |
| Method Summary | |
|---|---|
static Object |
executeForCurrentEnvironment(groovy.lang.Closure closure)
Takes an environment specific DSL block like:
environments {
development {}
production {}
}
And executes the closure that relates to the current environment |
static Object |
executeForEnvironment(Environment env,
groovy.lang.Closure closure)
Takes an environment specific DSL block like:
environments {
development {}
production {}
}
And executes the closure that relates to the specified environment |
static Environment |
getCurrent()
Returns the current environment which is typcally either DEVELOPMENT, PRODUCTION or TEST. |
static Environment |
getCurrentEnvironment()
|
static Environment |
getEnvironment(String shortName)
Returns the environment for the given short name |
static groovy.lang.Closure |
getEnvironmentSpecificBlock(groovy.lang.Closure closure)
Takes an environment specific DSL block like:
environments {
development {}
production {}
}
And returns the closure that relates to the current environment |
static groovy.lang.Closure |
getEnvironmentSpecificBlock(Environment env,
groovy.lang.Closure closure)
Takes an environment specific DSL block like:
environments {
development {}
production {}
}
And returns the closure that relates to the specified |
String |
getName()
|
String |
getReloadLocation()
|
boolean |
hasReloadLocation()
|
boolean |
isReloadEnabled()
|
static boolean |
isSystemSet()
|
void |
setName(String name)
|
static Environment |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static Environment[] |
values()
Returns an array containing the constants of this enum type, in the order they're declared. |
| Methods inherited from class java.lang.Enum |
|---|
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Enum Constant Detail |
|---|
public static final Environment DEVELOPMENT
public static final Environment PRODUCTION
public static final Environment TEST
public static final Environment APPLICATION
public static final Environment CUSTOM
| Field Detail |
|---|
public static String KEY
public static String RELOAD_ENABLED
public static final String RELOAD_LOCATION
public static final String DEFAULT
| Method Detail |
|---|
public static final Environment[] values()
for(Environment c : Environment.values())
System.out.println(c);
public static Environment valueOf(String name)
name - the name of the enum constant to be returned.
IllegalArgumentException - if this enum type has no constant
with the specified namepublic static Environment getCurrent()
public static Environment getCurrentEnvironment()
getCurrent()public static boolean isSystemSet()
public static Environment getEnvironment(String shortName)
shortName - The short name
public static groovy.lang.Closure getEnvironmentSpecificBlock(groovy.lang.Closure closure)
environments {
development {}
production {}
}
And returns the closure that relates to the current environment
closure - The top level closure
public static groovy.lang.Closure getEnvironmentSpecificBlock(Environment env,
groovy.lang.Closure closure)
environments {
development {}
production {}
}
And returns the closure that relates to the specified
env - The environment to useclosure - The top level closure
public static Object executeForCurrentEnvironment(groovy.lang.Closure closure)
environments {
development {}
production {}
}
And executes the closure that relates to the current environment
closure - The top level closure
public static Object executeForEnvironment(Environment env,
groovy.lang.Closure closure)
environments {
development {}
production {}
}
And executes the closure that relates to the specified environment
env - The environment to useclosure - The top level closure
public String getName()
public void setName(String name)
public boolean isReloadEnabled()
public String getReloadLocation()
public boolean hasReloadLocation()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||