Examples of JCacheInterceptor


Examples of org.springframework.cache.jcache.interceptor.JCacheInterceptor

    context.close();
  }

  @Test
  public void testCacheErrorHandler() {
    JCacheInterceptor ci = ctx.getBean(JCacheInterceptor.class);
    assertSame(ctx.getBean("errorHandler", CacheErrorHandler.class), ci.getErrorHandler());
  }
View Full Code Here

Examples of org.springframework.cache.jcache.interceptor.JCacheInterceptor

    assertSame(context.getBean(KeyGenerator.class), cos.getKeyGenerator());
    assertSame(context.getBean("cacheResolver", CacheResolver.class),
        cos.getCacheResolver());
    assertSame(context.getBean("exceptionCacheResolver", CacheResolver.class),
        cos.getExceptionCacheResolver());
    JCacheInterceptor interceptor = context.getBean(JCacheInterceptor.class);
    assertSame(context.getBean("errorHandler", CacheErrorHandler.class), interceptor.getErrorHandler());
  }
View Full Code Here

Examples of org.springframework.cache.jcache.interceptor.JCacheInterceptor

  @Test
  public void onlyOneInterceptorIsAvailable() {
    Map<String, JCacheInterceptor> interceptors = ctx.getBeansOfType(JCacheInterceptor.class);
    assertEquals("Only one interceptor should be defined", 1, interceptors.size());
    JCacheInterceptor interceptor = interceptors.values().iterator().next();
    assertEquals("Custom interceptor not defined", TestCacheInterceptor.class, interceptor.getClass());
  }
View Full Code Here

Examples of org.springframework.cache.jcache.interceptor.JCacheInterceptor

      return new ConcurrentMapCache("exception");
    }

    @Bean
    public JCacheInterceptor jCacheInterceptor(JCacheOperationSource cacheOperationSource) {
      JCacheInterceptor cacheInterceptor = new TestCacheInterceptor();
      cacheInterceptor.setCacheOperationSource(cacheOperationSource);
      return cacheInterceptor;
    }
View Full Code Here

Examples of org.springframework.cache.jcache.interceptor.JCacheInterceptor

  }

  @Bean(name = "jCacheInterceptor")
  @Role(BeanDefinition.ROLE_INFRASTRUCTURE)
  public JCacheInterceptor cacheInterceptor() {
    JCacheInterceptor interceptor = new JCacheInterceptor();
    interceptor.setCacheOperationSource(cacheOperationSource());
    if (this.errorHandler != null) {
      interceptor.setErrorHandler(this.errorHandler);
    }
    return interceptor;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.