|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTSFIELD | METHOD |
java.lang.Object grails.util.Environment
@SuppressWarnings("serial") public enum Environment
An enum that represents the current environment
Field Summary | |
---|---|
static java.lang.String |
DEFAULT
Constants that indicates whether this GrailsApplication is running in the default environment |
static java.lang.String |
KEY
An enum that represents the current environment |
static java.lang.String |
RELOAD_ENABLED
Specify whether reloading is enabled for this environment |
static java.lang.String |
RELOAD_LOCATION
The location where to reload resources from |
Method Summary | |
---|---|
static java.lang.Object
|
executeForCurrentEnvironment(groovy.lang.Closure closure)
Takes an environment specific DSL block like: |
static java.lang.Object
|
executeForEnvironment(Environment env, groovy.lang.Closure closure)
Takes an environment specific DSL block like: |
static Environment
|
getCurrent()
Returns the current environment which is typcally either DEVELOPMENT, PRODUCTION or TEST. |
static Environment
|
getCurrentEnvironment()
@see #getCurrent() |
static Environment
|
getEnvironment(java.lang.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: |
static groovy.lang.Closure
|
getEnvironmentSpecificBlock(Environment env, groovy.lang.Closure closure)
Takes an environment specific DSL block like: |
java.lang.String
|
getName()
@return the name of the environment |
java.lang.String
|
getReloadLocation()
@return Obtains the location to reload resources from |
boolean
|
hasReloadLocation()
@return Whether a reload location is specified |
static boolean
|
isDevelopmentMode()
Returns true if the application is running in development mode (within grails run-app) |
boolean
|
isReloadEnabled()
@return Returns whether reload is enabled for the environment |
static boolean
|
isSystemSet()
@return Return true if the environment has been set as a Systme property |
void
|
setName(java.lang.String name)
Set the name. |
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Field Detail |
---|
public static final java.lang.String DEFAULT
public static java.lang.String KEY
public static java.lang.String RELOAD_ENABLED
public static final java.lang.String RELOAD_LOCATION
Method Detail |
---|
public static java.lang.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 java.lang.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 static Environment getCurrent()
public static Environment getCurrentEnvironment()
public static Environment getEnvironment(java.lang.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 java.lang.String getName()
public java.lang.String getReloadLocation()
public boolean hasReloadLocation()
public static boolean isDevelopmentMode()
public boolean isReloadEnabled()
public static boolean isSystemSet()
public void setName(java.lang.String name)
name
- the name
Groovy Documentation