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


Java CacheRemove类代码示例

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


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

示例1: delete

import javax.cache.annotation.CacheRemove; //导入依赖的package包/类
/**
 * Delete a {@link SystemConfiguration}
 * 
 * @param name
 *            The configuration name to delete.
 */
@DELETE
@Path("{name}")
@CacheRemove(cacheName = "configuration")
public void delete(@CacheKey @PathParam("name") final String name) {
	repository.deleteAllBy("name", name);
}
 
开发者ID:ligoj,项目名称:bootstrap,代码行数:13,代码来源:ConfigurationResource.java

示例2: CacheRemoveOperation

import javax.cache.annotation.CacheRemove; //导入依赖的package包/类
public CacheRemoveOperation(
		CacheMethodDetails<CacheRemove> methodDetails, CacheResolver cacheResolver, KeyGenerator keyGenerator) {

	super(methodDetails, cacheResolver, keyGenerator);
	CacheRemove ann = methodDetails.getCacheAnnotation();
	this.exceptionTypeFilter = createExceptionTypeFilter(ann.evictFor(), ann.noEvictFor());
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:8,代码来源:CacheRemoveOperation.java

示例3: findCacheOperation

import javax.cache.annotation.CacheRemove; //导入依赖的package包/类
@Override
protected JCacheOperation<?> findCacheOperation(Method method, Class<?> targetType) {
	CacheResult cacheResult = method.getAnnotation(CacheResult.class);
	CachePut cachePut = method.getAnnotation(CachePut.class);
	CacheRemove cacheRemove = method.getAnnotation(CacheRemove.class);
	CacheRemoveAll cacheRemoveAll = method.getAnnotation(CacheRemoveAll.class);

	int found = countNonNull(cacheResult, cachePut, cacheRemove, cacheRemoveAll);
	if (found == 0) {
		return null;
	}
	if (found > 1) {
		throw new IllegalStateException("More than one cache annotation found on '" + method + "'");
	}

	CacheDefaults defaults = getCacheDefaults(method, targetType);
	if (cacheResult != null) {
		return createCacheResultOperation(method, defaults, cacheResult);
	}
	else if (cachePut != null) {
		return createCachePutOperation(method, defaults, cachePut);
	}
	else if (cacheRemove != null) {
		return createCacheRemoveOperation(method, defaults, cacheRemove);
	}
	else {
		return createCacheRemoveAllOperation(method, defaults, cacheRemoveAll);
	}
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:30,代码来源:AnnotationJCacheOperationSource.java

示例4: createCacheRemoveOperation

import javax.cache.annotation.CacheRemove; //导入依赖的package包/类
protected CacheRemoveOperation createCacheRemoveOperation(Method method, CacheDefaults defaults, CacheRemove ann) {
	String cacheName = determineCacheName(method, defaults, ann.cacheName());
	CacheResolverFactory cacheResolverFactory =
			determineCacheResolverFactory(defaults, ann.cacheResolverFactory());
	KeyGenerator keyGenerator = determineKeyGenerator(defaults, ann.cacheKeyGenerator());

	CacheMethodDetails<CacheRemove> methodDetails = createMethodDetails(method, ann, cacheName);
	CacheResolver cacheResolver = getCacheResolver(cacheResolverFactory, methodDetails);
	return new CacheRemoveOperation(methodDetails, cacheResolver, keyGenerator);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:11,代码来源:AnnotationJCacheOperationSource.java

示例5: createSimpleOperation

import javax.cache.annotation.CacheRemove; //导入依赖的package包/类
@Override
protected CacheRemoveOperation createSimpleOperation() {
	CacheMethodDetails<CacheRemove> methodDetails = create(CacheRemove.class,
			SampleObject.class, "simpleRemove", Long.class);

	return new CacheRemoveOperation(methodDetails, defaultCacheResolver, defaultKeyGenerator);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:8,代码来源:CacheRemoveOperationTests.java

示例6: earlyRemove

import javax.cache.annotation.CacheRemove; //导入依赖的package包/类
@Override
@CacheRemove(afterInvocation = false)
public void earlyRemove(String id) {
	Object key = SimpleKeyGenerator.generateKey(id);
	Cache.ValueWrapper valueWrapper = defaultCache.get(key);
	if (valueWrapper != null) {
		throw new AssertionError("Value with key " + key + " expected to be already remove from cache");
	}
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:10,代码来源:AnnotatedJCacheableService.java

示例7: simpleRemove

import javax.cache.annotation.CacheRemove; //导入依赖的package包/类
@CacheRemove(cacheName = "simpleCache")
public void simpleRemove(Long id) {
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:4,代码来源:SampleObject.java

示例8: multiAnnotations

import javax.cache.annotation.CacheRemove; //导入依赖的package包/类
@CacheRemove
@CacheRemoveAll
public void multiAnnotations() {
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:5,代码来源:AnnotationCacheOperationSourceTests.java

示例9: evict

import javax.cache.annotation.CacheRemove; //导入依赖的package包/类
@CacheRemove
public void evict(long id) {
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:4,代码来源:JCacheErrorHandlerTests.java

示例10: remove

import javax.cache.annotation.CacheRemove; //导入依赖的package包/类
@Override
@CacheRemove
public void remove(String id) {
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:5,代码来源:AnnotatedJCacheableService.java

示例11: removeWithException

import javax.cache.annotation.CacheRemove; //导入依赖的package包/类
@Override
@CacheRemove(noEvictFor = NullPointerException.class)
public void removeWithException(@CacheKey String id, boolean matchFilter) {
	throwException(matchFilter);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:6,代码来源:AnnotatedJCacheableService.java

示例12: earlyRemoveWithException

import javax.cache.annotation.CacheRemove; //导入依赖的package包/类
@Override
@CacheRemove(afterInvocation = false, evictFor = UnsupportedOperationException.class)
public void earlyRemoveWithException(@CacheKey String id, boolean matchFilter) {
	throwException(matchFilter);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:6,代码来源:AnnotatedJCacheableService.java

示例13: clear

import javax.cache.annotation.CacheRemove; //导入依赖的package包/类
@CacheRemove
public void clear(@CacheKey String key) {
}
 
开发者ID:gitblit,项目名称:fathom,代码行数:4,代码来源:JCacheTest.java

示例14: updateDataset

import javax.cache.annotation.CacheRemove; //导入依赖的package包/类
@CacheRemove(cacheName = "heavyComputation")
public void updateDataset(){
    LOG.info("updateDataset");
}
 
开发者ID:victorbuckservices,项目名称:workshop-spring-4.0-to-4.2,代码行数:5,代码来源:CacheableService.java

示例15: removeUser

import javax.cache.annotation.CacheRemove; //导入依赖的package包/类
@CacheRemove(cacheName = "users")
public void removeUser(@CacheKey String name) {
    //...
}
 
开发者ID:kasunbg,项目名称:jcache-samples,代码行数:5,代码来源:UserManager.java


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