Package org.ofbiz.entity.cache

Examples of org.ofbiz.entity.cache.Cache


        }
       
        this.modelReader = ModelReader.getModelReader(delegatorBaseName);
        this.modelGroupReader = ModelGroupReader.getModelGroupReader(delegatorBaseName);

        cache = new Cache(delegatorFullName);

        // do the entity model check
        List<String> warningList = FastList.newInstance();
        Debug.logImportant("Doing entity definition check...", module);
        ModelEntityChecker.checkEntities(this, warningList);
View Full Code Here


        }
       
        this.modelReader = ModelReader.getModelReader(delegatorBaseName);
        this.modelGroupReader = ModelGroupReader.getModelGroupReader(delegatorBaseName);

        cache = new Cache(delegatorFullName);

        // do the entity model check
        List<String> warningList = FastList.newInstance();
        Debug.logImportant("Doing entity definition check...", module);
        ModelEntityChecker.checkEntities(this, warningList);
View Full Code Here

            throw (IOException) new IOException(e.getMessage()).initCause(e);
        }
    }

    protected Set<String> getSuffixes() throws Exception {
        Cache cache = delegator.getCache();
        Set<String> suffixes;
        synchronized (WebslingerContextMapper.class) {
            suffixes = (Set<String>) cache.get("WebslingerHostSuffix", null, "WebslingerContextMapper.Suffixes");
            if (suffixes == null) {
                suffixes = new HashSet<String>();
                for (GenericValue value: delegator.findList("WebslingerHostSuffix", null, null, null, null, false)) {
                    suffixes.add(value.getString("hostSuffix"));
                }
                cache.put("WebslingerHostSuffix", null, "WebslingerContextMapper.Suffixes", suffixes);
            }
        }
        return suffixes;
    }
View Full Code Here

        this.delegatorName = delegatorName;
        this.modelReader = ModelReader.getModelReader(delegatorName);
        this.modelGroupReader = ModelGroupReader.getModelGroupReader(delegatorName);

        cache = new Cache(delegatorName);

        // do the entity model check
        List<String> warningList = FastList.newInstance();
        Debug.logImportant("Doing entity definition check...", module);
        ModelEntityChecker.checkEntities(this, warningList);
View Full Code Here

        this.delegatorName = delegatorName;
        this.modelReader = ModelReader.getModelReader(delegatorName);
        this.modelGroupReader = ModelGroupReader.getModelGroupReader(delegatorName);

        cache = new Cache(delegatorName);

        // do the entity model check
        List<String> warningList = FastList.newInstance();
        Debug.logImportant("Doing entity definition check...", module);
        ModelEntityChecker.checkEntities(this, warningList);
View Full Code Here

        this.delegatorName = delegatorName;
        this.modelReader = ModelReader.getModelReader(delegatorName);
        this.modelGroupReader = ModelGroupReader.getModelGroupReader(delegatorName);

        cache = new Cache(delegatorName);

        // do the entity model check
        List<String> warningList = FastList.newInstance();
        Debug.logImportant("Doing entity definition check...", module);
        ModelEntityChecker.checkEntities(this, warningList);
View Full Code Here

        }

        this.modelReader = ModelReader.getModelReader(delegatorBaseName);
        this.modelGroupReader = ModelGroupReader.getModelGroupReader(delegatorBaseName);

        cache = new Cache(delegatorFullName);

        // do the entity model check
        List<String> warningList = FastList.newInstance();
        Debug.logImportant("Doing entity definition check...", module);
        ModelEntityChecker.checkEntities(this, warningList);
View Full Code Here

        }
       
        this.modelReader = ModelReader.getModelReader(delegatorBaseName);
        this.modelGroupReader = ModelGroupReader.getModelGroupReader(delegatorBaseName);

        cache = new Cache(delegatorFullName);

        // do the entity model check
        List<String> warningList = FastList.newInstance();
        Debug.logImportant("Doing entity definition check...", module);
        ModelEntityChecker.checkEntities(this, warningList);
View Full Code Here

            return false;
        }
    }   
   
    private List<String> getPermissionAutoGrant(String permission) {
        Cache cache = delegator.getCache();
        EntityCondition condition = EntityCondition.makeCondition(UtilMisc.toMap("permissionId", permission));
        List<String> autoGrants = cache.get("SecurityPermissionAutoGrant", condition, "EntityAuthorization.autoGrants");
        if (autoGrants == null) {
            autoGrants = FastList.newInstance();
           
            List<GenericValue> values = null;
            try {
                values = delegator.findList("SecurityPermissionAutoGrant", condition, null, null, null, true);
            } catch (GenericEntityException e) {
                Debug.logWarning(e, module);
            }
           
            if (UtilValidate.isNotEmpty(values)) {
                for (GenericValue v : values) {
                    autoGrants.add(v.getString("grantPermission"));
                }
            }
            cache.put("SecurityPermissionAutoGrant", condition, "EntityAuthorization.autoGrants", autoGrants);
        }
        return autoGrants;
    }
View Full Code Here

        }
    }

    @Override
    protected Set<String> getSuffixes() throws Exception {
        Cache cache = delegator.getCache();
        Set<String> suffixes;
        synchronized (WebslingerContextMapper.class) {
            suffixes = cache.get("WebslingerHostSuffix", null, "WebslingerContextMapper.Suffixes");
            if (suffixes == null) {
                suffixes = new HashSet<String>();
                for (GenericValue value: delegator.findList("WebslingerHostSuffix", null, null, null, null, false)) {
                    suffixes.add(value.getString("hostSuffix"));
                }
                cache.put("WebslingerHostSuffix", null, "WebslingerContextMapper.Suffixes", suffixes);
            }
        }
        return suffixes;
    }
View Full Code Here

TOP

Related Classes of org.ofbiz.entity.cache.Cache

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.