Package cn.org.rapid_framework.cache.aop.annotation

Examples of cn.org.rapid_framework.cache.aop.annotation.MethodCache


    public Object invoke(MethodInvocation invocation) throws Throwable
        if (invocation.getMethod().isAnnotationPresent(MethodCache.class)) { 
          String targetName = invocation.getThis().getClass().getName();
            String methodName = invocation.getMethod().getName()
            Object[] arguments = invocation.getArguments()
            MethodCache annotation = invocation.getMethod().getAnnotation(MethodCache.class);
            String cacheKey = getCackeKey(targetName, methodName, arguments,annotation);
            int expireSeconds = (int)annotation.timeUnit().toSeconds(annotation.expireTime());
            return getResult(cacheKey, invocation,expireSeconds);
        } else
            return invocation.proceed()
       
    }
View Full Code Here

TOP

Related Classes of cn.org.rapid_framework.cache.aop.annotation.MethodCache

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.