Package com.ciaranwood.tapestry.cache.services

Examples of com.ciaranwood.tapestry.cache.services.CacheLocator


        this.log = log;
        this.cacheKeyParameterIndex = cacheKeyParameterIndex;
    }

    public void advise(Invocation invocation) {
        CacheLocator key = getKeyForInvocation(invocation);
        Element cached = cache.get(key);
        if(cached == null) {
            log.debug("cache miss for {} using cache {}", key, cache.getName());
            invocation.proceed();
            Object result = invocation.getResult();
View Full Code Here


    }

    private CacheLocator getKeyForInvocation(Invocation invocation) {
        String methodName = invocation.getMethodName();
        if(cacheKeyParameterIndex == -1) {
            return new CacheLocator(methodName);
        } else {
            Object key = invocation.getParameter(cacheKeyParameterIndex);
            return new CacheLocator(methodName, key);
        }
    }
View Full Code Here

TOP

Related Classes of com.ciaranwood.tapestry.cache.services.CacheLocator

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.