Package org.jeecgframework.core.annotation

Examples of org.jeecgframework.core.annotation.Ehcache


    Object[] arguments = joinPoint.getArgs()
   
    //试图得到标注的Ehcache类
    @SuppressWarnings("unused")
    Method[] methods = joinPoint.getTarget().getClass().getMethods();
    Ehcache flag = null;
    for(Method m:methods){
      if(m.getName().equals(methodName)){
        Class[] tmpCs = m.getParameterTypes()
                if(tmpCs.length==arguments.length){ 
                  flag = m.getAnnotation(Ehcache.class);
            break;
           
      }
    }
    if(flag==null){
      return null;
    }
    //Ehcache flag =joinPoint.getTarget().getClass().getMethod(methodName).getAnnotation(Ehcache.class);
    Object result;
    String cacheKey = getCacheKey(targetName, methodName, arguments);
   
    Element element = null;
    if(flag.eternal()){
      //永久缓存
       element = dictCache.get(cacheKey);
    }else{
      //临时缓存
       element = eternalCache.get(cacheKey);
    }
   

    if (element == null) {
      if ((arguments != null) && (arguments.length != 0)) {
        result = joinPoint.proceed(arguments);
      } else {
        result = joinPoint.proceed();
      }

      element = new Element(cacheKey, (Serializable) result);
      if(flag.eternal()){
        //永久缓存
        dictCache.put(element);
      }else{
        //临时缓存
        eternalCache.put(element);
View Full Code Here

TOP

Related Classes of org.jeecgframework.core.annotation.Ehcache

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.