当前位置: 首页>>代码示例>>Java>>正文


Java CacheDelete类代码示例

本文整理汇总了Java中com.jarvis.cache.annotation.CacheDelete的典型用法代码示例。如果您正苦于以下问题:Java CacheDelete类的具体用法?Java CacheDelete怎么用?Java CacheDelete使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CacheDelete类属于com.jarvis.cache.annotation包,在下文中一共展示了CacheDelete类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: delete

import com.jarvis.cache.annotation.CacheDelete; //导入依赖的package包/类
/**
 * 删除对象,并删除其缓存,再删除以及对象集合变更后,失效的查询缓存
 */
@CacheDelete({//
        @CacheDeleteKey(value = KEY_USER, hfield = "#args[0]", condition = "null != #args[0]"), //
        @CacheDeleteKey(value = KEY_USER_FIND) //
})
public void delete(Long id) {
    userData.delete(id);
}
 
开发者ID:yrain,项目名称:smart-cache,代码行数:11,代码来源:AutoLoadUserDao.java

示例2: DelCacheAopInterceptor

import com.jarvis.cache.annotation.CacheDelete; //导入依赖的package包/类
public DelCacheAopInterceptor(AbstractCacheManager cacheManager, CacheDelete cache, Method method) {
    this.cacheManager=cacheManager;
    this.cache=cache;
    if(method.isAnnotationPresent(CacheDelete.class)) {
        this.haveCache=true;
    }
}
 
开发者ID:qiujiayu,项目名称:AutoLoadCache-nutz,代码行数:8,代码来源:DelCacheAopInterceptor.java

示例3: deleteCache

import com.jarvis.cache.annotation.CacheDelete; //导入依赖的package包/类
/**
 * 处理@CacheDelete 拦截
 * @param jp 切点
 * @param cacheDelete 拦截到的注解
 * @param retVal 返回值
 */
public void deleteCache(DeleteCacheAopProxyChain jp, CacheDelete cacheDelete, Object retVal) throws Throwable {
    Object[] arguments=jp.getArgs();
    CacheDeleteKey[] keys=cacheDelete.value();
    if(null == keys || keys.length == 0) {
        return;
    }
    Object target=jp.getTarget();
    String methodName=jp.getMethod().getName();
    try {
        for(int i=0; i < keys.length; i++) {
            CacheDeleteKey keyConfig=keys[i];
            String[] tempKeys=keyConfig.value();
            String tempHfield=keyConfig.hfield();
            if(!scriptParser.isCanDelete(keyConfig, arguments, retVal)) {
                continue;
            }
            for(String tempKey: tempKeys) {
                CacheKeyTO key=getCacheKey(target, methodName, arguments, tempKey, tempHfield, retVal, true);
                if(null != key && !CacheHelper.addDeleteCacheKey(key)) {
                    this.delete(key);
                    this.getAutoLoadHandler().resetAutoLoadLastLoadTime(key);
                }
            }
        }
    } catch(Throwable e) {
        log.error(e.getMessage(), e);
        throw e;
    }
}
 
开发者ID:qiujiayu,项目名称:AutoLoadCache,代码行数:36,代码来源:CacheHandler.java

示例4: checkAndDeleteCache

import com.jarvis.cache.annotation.CacheDelete; //导入依赖的package包/类
public void checkAndDeleteCache(JoinPoint jp, Object retVal) throws Throwable {
    Signature signature=jp.getSignature();
    MethodSignature methodSignature=(MethodSignature)signature;
    Method method=methodSignature.getMethod();
    if(method.isAnnotationPresent(CacheDelete.class)) {
        CacheDelete cacheDelete=method.getAnnotation(CacheDelete.class);
        this.deleteCache(jp, cacheDelete, retVal);
    }
}
 
开发者ID:qiujiayu,项目名称:AutoLoadCache,代码行数:10,代码来源:AspectjAopInterceptor.java

示例5: create

import com.jarvis.cache.annotation.CacheDelete; //导入依赖的package包/类
/**
 * 创建对象后并缓存,再删除因对象集合变更后,失效的查询缓存
 */
@Cache(key = KEY_USER, hfield = "#retVal.id", expire = EXPIRE, opType = CacheOpType.WRITE)
@CacheDelete({ @CacheDeleteKey(value = KEY_USER_FIND) })
public User create() {
    return userData.create();
}
 
开发者ID:yrain,项目名称:smart-cache,代码行数:9,代码来源:AutoLoadUserDao.java

示例6: makeIt

import com.jarvis.cache.annotation.CacheDelete; //导入依赖的package包/类
public List<? extends MethodInterceptor> makeIt(CacheDelete cache, Method method, Ioc ioc) {
    return Arrays.asList(new DelCacheAopInterceptor(ioc.get(AbstractCacheManager.class, "cachePointCut"), cache, method));
}
 
开发者ID:qiujiayu,项目名称:AutoLoadCache-nutz,代码行数:4,代码来源:DelCacheAopConfigration.java

示例7: deleteCache

import com.jarvis.cache.annotation.CacheDelete; //导入依赖的package包/类
public void deleteCache(JoinPoint aopProxyChain, CacheDelete cacheDelete, Object retVal) throws Throwable {
    cacheHandler.deleteCache(new AspectjDeleteCacheAopProxyChain(aopProxyChain), cacheDelete, retVal);
}
 
开发者ID:qiujiayu,项目名称:AutoLoadCache,代码行数:4,代码来源:AspectjAopInterceptor.java


注:本文中的com.jarvis.cache.annotation.CacheDelete类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。