/** * @see #getCurrent() * @return the current environment */ public static Environment getCurrentEnvironment() { return getCurrent(); }
/** * This method will return true the application is run * * @return True if the development sources are present */ public static boolean isDevelopmentRun() { Environment env = Environment.getCurrent(); return isDevelopmentEnvironmentAvailable() && Boolean.getBoolean(RUN_ACTIVE) && (env == Environment.DEVELOPMENT); }
public static boolean isReloadingAgentEnabled() { if(reloadingAgentEnabled != null) { return reloadingAgentEnabled; } try { Class.forName("org.springsource.loaded.TypeRegistry"); reloadingAgentEnabled = Environment.getCurrent().isReloadEnabled(); } catch (ClassNotFoundException e) { reloadingAgentEnabled = false; } return reloadingAgentEnabled; }
/** * Takes an environment specific DSL block like: * * <code> * environments { * development {} * production {} * } * </code> * * And returns the closure that relates to the current environment * * @param closure The top level closure * @return The environment specific block or null if non exists */ public static Closure<?> getEnvironmentSpecificBlock(Closure<?> closure) { final Environment env = getCurrent(); return getEnvironmentSpecificBlock(env, closure); }
/** * Takes an environment specific DSL block like: * * <code> * environments { * development {} * production {} * } * </code> * * And executes the closure that relates to the current environment * * @param closure The top level closure * @return The result of the closure execution */ public static Object executeForCurrentEnvironment(Closure<?> closure) { final Environment env = getCurrent(); return executeForEnvironment(env, closure); }
@Override protected Set<String> doGetActiveProfiles() { Set<String> activeProfiles = super.doGetActiveProfiles(); activeProfiles.add(Environment.getCurrent().getName()); return activeProfiles; }
if (!grails.util.Environment.getCurrent().isReloadEnabled() || !proxyIfReloadEnabled) { return sf;