Package grails.util

Examples of grails.util.Environment


        plugins.put(plugin.getName(), plugin);
        classNameToPluginMap.put(plugin.getPluginClass().getName(), plugin);
    }

    protected boolean canRegisterPlugin(GrailsPlugin plugin) {
        Environment environment = Environment.getCurrent();
        return plugin.isEnabled() && plugin.supportsEnvironment(environment);
    }
View Full Code Here


    protected List<String> propertyNames;
    @Override
    public String[] getPropertyNames() {
        if(propertyNames == null) {
            propertyNames = new ArrayList<String>();
            Environment env = Environment.getCurrent();
            String key = "environments." + env.getName();
            for(PropertySource propertySource : source) {
                if((propertySource != this) && propertySource instanceof EnumerablePropertySource) {
                    EnumerablePropertySource enumerablePropertySource = (EnumerablePropertySource)propertySource;

                    for(String propertyName : enumerablePropertySource.getPropertyNames()) {
View Full Code Here

    public Object getProperty(String name) {
        if(!propertyNames.contains(name)) {
            return null;
        }

        Environment env = Environment.getCurrent();
        String key = "environments." + env.getName() + '.' + name;
        for(PropertySource propertySource : source) {
            if(propertySource != this) {
                Object value = propertySource.getProperty(key);
                if(value != null) return value;
            }
View Full Code Here

        pluginEnvs = evaluateIncludeExcludeProperty(ENVIRONMENTS, new Closure(this) {
            private static final long serialVersionUID = 1;
            @Override
            public Object call(Object arguments) {
                String envName = (String)arguments;
                Environment env = Environment.getEnvironment(envName);
                if (env != null) return env.getName();
                return arguments;
            }
        });
    }
View Full Code Here

            if (resourceList == null) {
                return;
            }

            List<String> resourceListTmp = new ArrayList<String>();
            final Environment env = Environment.getCurrent();
            final String baseLocation = env.getReloadLocation();

            for (Object ref : resourceList) {
                String stringRef = ref.toString();
                if (warDeployed) {
                    addBaseLocationPattern(resourceListTmp, baseLocation, stringRef);
View Full Code Here

        return supportsValueInIncludeExcludeMap(pluginEnvs, environment.getName());
    }

    public boolean supportsCurrentScopeAndEnvironment() {
        BuildScope bs = BuildScope.getCurrent();
        Environment e = Environment.getCurrent();
        return supportsEnvironment(e) && supportsScope(bs);
    }
View Full Code Here

TOP

Related Classes of grails.util.Environment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.