Examples of ERXMultiKey


Examples of er.extensions.foundation.ERXMultiKey

        for (short i=0; i<s; i++) {
            //lhsKeys[i]=context.valueForKeyPathNoInference(significantKeys[i]);
            lhsKeys[i]=ERD2WUtilities.contextValueForKeyNoInferenceNoException(context, significantKeys[i]);
        }
        lhsKeys[s]=keyPath;
        ERXMultiKey k=new ERXMultiKey(lhsKeys);

        Object result=useCache ? cache.get(k) : null;
        if (result==null) {
            boolean resetTraceRuleFiring = false;
            Logger ruleFireLog=null;
View Full Code Here

Examples of er.extensions.foundation.ERXMultiKey

        Object value = decodeObject(in.readObject());
        for (short i=0; i<keys.length; i++) {
            Object o=decodeObject(keys[i]);
            keys[i]=o;
        }
        ERXMultiKey key = new ERXMultiKey(keys);
        cache.put(key,value);
        return key;
    }
View Full Code Here

Examples of er.extensions.foundation.ERXMultiKey

    protected byte[] cacheToBytes(Hashtable cache) {
        try {
            ByteArrayOutputStream ostream = new ByteArrayOutputStream();
            ObjectOutputStream out = new ObjectOutputStream(ostream);
            for(Enumeration keys = cache.keys(); keys.hasMoreElements();) {
                ERXMultiKey key = (ERXMultiKey)keys.nextElement();
                Object o = cache.get(key);
                if(writeEntry(key,o,out)) {
                  if(log.isDebugEnabled())
                        log.debug("Wrote: " + key + " -- " + o);
                } else {
View Full Code Here

Examples of er.extensions.foundation.ERXMultiKey

      ObjectInputStream in = new ERXMappingObjectStream(istream);
            Hashtable newCache = new Hashtable(10000);
            try {
                //FIXME ak how do I do without the EOFException?
                for(;;) {
                    ERXMultiKey key = readEntry(newCache,in);
                    Object o = newCache.get(key);
                    if(log.isDebugEnabled()) {
                        log.debug("Read: " + key + " -- " + o);
                    }
                }
View Full Code Here

Examples of er.extensions.foundation.ERXMultiKey

    public boolean actionNameIsCachableForClass(Class actionClass, String actionName) {
        return policyCacheEntryForClass(actionClass, actionName) != null;
    }

    public ERXMultiKey cacheKeyForRequest(Class actionClass, String actionName, WORequest request) {
        ERXMultiKey cacheKey = null;
        PolicyCacheEntry cacheEntry = policyCacheEntryForClass(actionClass, actionName);
        if (cacheEntry != null) {
            int count = 0;
            Object[] cache = new Object[cacheEntry.count + 2];
            cache[count++] = actionClass;
            cache[count++] = actionName;
            if (cacheEntry.formKeys.count() > 0) {
                for (Enumeration formKeyEnumerator = cacheEntry.formKeys.objectEnumerator();
                     formKeyEnumerator.hasMoreElements();) {
                    String formKey = (String)formKeyEnumerator.nextElement();
                    cache[count++] = request.formValueForKey(formKey);
                }
            }
            if (cacheEntry.headerKeys.count() > 0) {
                for (Enumeration headerKeyEnumerator = cacheEntry.headerKeys.objectEnumerator();
                     headerKeyEnumerator.hasMoreElements();) {
                    String headerKey = (String)headerKeyEnumerator.nextElement();
                    cache[count++] = request.headerForKey(headerKey);
                }               
            }
            if (cacheEntry.cookieKeys.count() > 0) {
                for (Enumeration cookieKeyEnumerator = cacheEntry.cookieKeys.objectEnumerator();
                     cookieKeyEnumerator.hasMoreElements();) {
                    String cookieKey = (String)cookieKeyEnumerator.nextElement();
                    cache[count++] = request.cookieValueForKey(cookieKey);
                }               
            }
            cacheKey = new ERXMultiKey(cache);
        }
        return cacheKey;
    }
View Full Code Here

Examples of er.extensions.foundation.ERXMultiKey

   
    public WOResponse cachedResponseForRequest(Class actionClass, String actionName, WORequest request) {
        if (policy().shouldResetCache()) {
            flushCache();
        }
        ERXMultiKey cacheKey = policy().cacheKeyForRequest(actionClass, actionName, request);
        return cacheKey != null ? (WOResponse)cache.get(cacheKey) : null;
    }
View Full Code Here

Examples of er.extensions.foundation.ERXMultiKey

        return cacheKey != null ? (WOResponse)cache.get(cacheKey) : null;
    }

    public void cacheResponseForRequest(Class actionClass, String actionName, WORequest request, WOResponse response) {
        if(response.headerForKey(NO_CACHE_KEY) == null) {
            ERXMultiKey cacheKey = policy().cacheKeyForRequest(actionClass, actionName, request);
            if (cacheKey != null) {
                cache.put(cacheKey, response);
            }
        } else {
            response.removeHeadersForKey(NO_CACHE_KEY);
View Full Code Here

Examples of er.extensions.foundation.ERXMultiKey

                targetLanguage = ERXLocalizer.currentLocalizer() != null ? ERXLocalizer.currentLocalizer().language() : ERXLocalizer.defaultLanguage();
            }
           
            if (log.isDebugEnabled ())
                log.debug("templateForException with entityName: " + entityName + "; property: " + property + "; type: " + type + "; targetLanguage: " + targetLanguage);
            ERXMultiKey k = new ERXMultiKey (new Object[] {entityName, property,
                type,targetLanguage});
            template = _cache.get(k);
            // Not in the cache.  Simple resolving.
            if (template == null) {
                template = templateForEntityPropertyType(entityName, property, type, targetLanguage);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.