Java Code Examples for org.springframework.cache.interceptor.SimpleCacheResolver

The following examples show how to use org.springframework.cache.interceptor.SimpleCacheResolver. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: spring-analysis-note   Source File: EnableCachingTests.java    License: MIT License 5 votes vote down vote up
@Test
public void emptyConfigSupport() {
	ConfigurableApplicationContext context = new AnnotationConfigApplicationContext(EmptyConfigSupportConfig.class);
	CacheInterceptor ci = context.getBean(CacheInterceptor.class);
	assertNotNull(ci.getCacheResolver());
	assertEquals(SimpleCacheResolver.class, ci.getCacheResolver().getClass());
	assertSame(context.getBean(CacheManager.class), ((SimpleCacheResolver)ci.getCacheResolver()).getCacheManager());
	context.close();
}
 
Example 2
@Override
protected CacheResolver getDefaultCacheResolver() {
	if (getCacheResolver() == null) {
		this.cacheResolver = SingletonSupplier.of(new SimpleCacheResolver(getDefaultCacheManager()));
	}
	return getCacheResolver();
}
 
Example 3
Source Project: spring-analysis-note   Source File: JCacheJavaConfigTests.java    License: MIT License 5 votes vote down vote up
@Test
public void emptyConfigSupport() {
	ConfigurableApplicationContext context =
			new AnnotationConfigApplicationContext(EmptyConfigSupportConfig.class);

	DefaultJCacheOperationSource cos = context.getBean(DefaultJCacheOperationSource.class);
	assertNotNull(cos.getCacheResolver());
	assertEquals(SimpleCacheResolver.class, cos.getCacheResolver().getClass());
	assertSame(context.getBean(CacheManager.class),
			((SimpleCacheResolver) cos.getCacheResolver()).getCacheManager());
	assertNull(cos.getExceptionCacheResolver());
	context.close();
}
 
Example 4
@Test
@Ignore("AspectJ has some sort of caching that makes this one fail")
public void emptyConfigSupport() {
	load(EmptyConfigSupportConfig.class);
	AnnotationCacheAspect aspect = this.ctx.getBean(AnnotationCacheAspect.class);
	assertNotNull(aspect.getCacheResolver());
	assertEquals(SimpleCacheResolver.class, aspect.getCacheResolver().getClass());
	assertSame(this.ctx.getBean(CacheManager.class),
			((SimpleCacheResolver) aspect.getCacheResolver()).getCacheManager());
}
 
Example 5
Source Project: java-technology-stack   Source File: EnableCachingTests.java    License: MIT License 5 votes vote down vote up
@Test
public void emptyConfigSupport() {
	ConfigurableApplicationContext context = new AnnotationConfigApplicationContext(EmptyConfigSupportConfig.class);
	CacheInterceptor ci = context.getBean(CacheInterceptor.class);
	assertNotNull(ci.getCacheResolver());
	assertEquals(SimpleCacheResolver.class, ci.getCacheResolver().getClass());
	assertSame(context.getBean(CacheManager.class), ((SimpleCacheResolver)ci.getCacheResolver()).getCacheManager());
	context.close();
}
 
Example 6
@Override
protected CacheResolver getDefaultCacheResolver() {
	if (getCacheResolver() == null) {
		this.cacheResolver = SingletonSupplier.of(new SimpleCacheResolver(getDefaultCacheManager()));
	}
	return getCacheResolver();
}
 
Example 7
Source Project: java-technology-stack   Source File: JCacheJavaConfigTests.java    License: MIT License 5 votes vote down vote up
@Test
public void emptyConfigSupport() {
	ConfigurableApplicationContext context =
			new AnnotationConfigApplicationContext(EmptyConfigSupportConfig.class);

	DefaultJCacheOperationSource cos = context.getBean(DefaultJCacheOperationSource.class);
	assertNotNull(cos.getCacheResolver());
	assertEquals(SimpleCacheResolver.class, cos.getCacheResolver().getClass());
	assertSame(context.getBean(CacheManager.class),
			((SimpleCacheResolver) cos.getCacheResolver()).getCacheManager());
	assertNull(cos.getExceptionCacheResolver());
	context.close();
}
 
Example 8
@Test
@Ignore("AspectJ has some sort of caching that makes this one fail")
public void emptyConfigSupport() {
	load(EmptyConfigSupportConfig.class);
	AnnotationCacheAspect aspect = this.ctx.getBean(AnnotationCacheAspect.class);
	assertNotNull(aspect.getCacheResolver());
	assertEquals(SimpleCacheResolver.class, aspect.getCacheResolver().getClass());
	assertSame(this.ctx.getBean(CacheManager.class),
			((SimpleCacheResolver) aspect.getCacheResolver()).getCacheManager());
}
 
Example 9
@Override
protected CacheResolver getDefaultCacheResolver() {
	if (this.cacheResolver == null) {
		this.cacheResolver = new SimpleCacheResolver(getDefaultCacheManager());
	}
	return this.cacheResolver;
}
 
Example 10
Source Project: spring4-understanding   Source File: EnableCachingTests.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void emptyConfigSupport() {
	ConfigurableApplicationContext context =
			new AnnotationConfigApplicationContext(EmptyConfigSupportConfig.class);

	CacheInterceptor ci = context.getBean(CacheInterceptor.class);
	assertNotNull(ci.getCacheResolver());
	assertEquals(SimpleCacheResolver.class, ci.getCacheResolver().getClass());
	assertSame(context.getBean(CacheManager.class),
			((SimpleCacheResolver)ci.getCacheResolver()).getCacheManager());
	context.close();
}
 
Example 11
@Override
protected CacheResolver getDefaultCacheResolver() {
	if (this.cacheResolver == null) {
		this.cacheResolver = new SimpleCacheResolver(getDefaultCacheManager());
	}
	return this.cacheResolver;
}
 
Example 12
@Test
public void emptyConfigSupport() {
	ConfigurableApplicationContext context =
			new AnnotationConfigApplicationContext(EmptyConfigSupportConfig.class);

	DefaultJCacheOperationSource cos = context.getBean(DefaultJCacheOperationSource.class);
	assertNotNull(cos.getCacheResolver());
	assertEquals(SimpleCacheResolver.class, cos.getCacheResolver().getClass());
	assertSame(context.getBean(CacheManager.class),
			((SimpleCacheResolver) cos.getCacheResolver()).getCacheManager());
	assertNull(cos.getExceptionCacheResolver());
	context.close();
}
 
Example 13
Source Project: spring-analysis-note   Source File: JCacheJavaConfigTests.java    License: MIT License 4 votes vote down vote up
@Override
@Bean
public CacheResolver cacheResolver() {
	return new SimpleCacheResolver(cacheManager());
}
 
Example 14
Source Project: spring-analysis-note   Source File: JCacheJavaConfigTests.java    License: MIT License 4 votes vote down vote up
@Override
@Bean
public CacheResolver exceptionCacheResolver() {
	return new SimpleCacheResolver(cacheManager());
}
 
Example 15
Source Project: java-technology-stack   Source File: JCacheJavaConfigTests.java    License: MIT License 4 votes vote down vote up
@Override
@Bean
public CacheResolver cacheResolver() {
	return new SimpleCacheResolver(cacheManager());
}
 
Example 16
Source Project: java-technology-stack   Source File: JCacheJavaConfigTests.java    License: MIT License 4 votes vote down vote up
@Override
@Bean
public CacheResolver exceptionCacheResolver() {
	return new SimpleCacheResolver(cacheManager());
}
 
Example 17
@Override
@Bean
public CacheResolver cacheResolver() {
	return new SimpleCacheResolver(cacheManager());
}
 
Example 18
@Override
@Bean
public CacheResolver exceptionCacheResolver() {
	return new SimpleCacheResolver(cacheManager());
}
 
Example 19
Source Project: java-platform   Source File: CacheConfiguration.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public CacheResolver cacheResolver() {
	return new SimpleCacheResolver(cacheManager());
}
 
Example 20
Source Project: cloudbreak   Source File: CachingConfig.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public CacheResolver cacheResolver() {
    return new SimpleCacheResolver(cacheManager());
}
 
Example 21
Source Project: cloudbreak   Source File: CachingConfig.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public CacheResolver cacheResolver() {
    return new SimpleCacheResolver(cacheManager());
}
 
Example 22
Source Project: cloudbreak   Source File: CachingConfig.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public CacheResolver cacheResolver() {
    return new SimpleCacheResolver(cacheManager());
}