Package org.springframework.cache.interceptor

Examples of org.springframework.cache.interceptor.CacheOperationInvoker


  @Override
  public Object invoke(final MethodInvocation invocation) throws Throwable {
    Method method = invocation.getMethod();

    CacheOperationInvoker aopAllianceInvoker = new CacheOperationInvoker() {
      @Override
      public Object invoke() {
        try {
          return invocation.proceed();
        }
View Full Code Here


    return targetClass;
  }

  @SuppressWarnings("unchecked")
  private Object execute(CacheOperationInvocationContext<?> context, CacheOperationInvoker invoker) {
    CacheOperationInvoker adapter = new CacheOperationInvokerAdapter(invoker);
    BasicOperation operation = context.getOperation();

    if (operation instanceof CacheResultOperation) {
      return cacheResultInterceptor.invoke(
          (CacheOperationInvocationContext<CacheResultOperation>) context, adapter);
View Full Code Here

        cacheManager, defaultCacheResolver, defaultExceptionCacheResolver, defaultKeyGenerator));

    AnnotatedJCacheableService service = new AnnotatedJCacheableService(cacheManager.getCache("default"));
    Method method = ReflectionUtils.findMethod(AnnotatedJCacheableService.class, "cache", String.class);

    CacheOperationInvoker invoker = new DummyInvoker(0L);
    Object execute = interceptor.execute(invoker, service, method, new Object[] {"myId"});
    assertNotNull("result cannot be null.", execute);
    assertEquals("Wrong result type", Long.class, execute.getClass());
    assertEquals("Wrong result", 0L, execute);
  }
View Full Code Here

TOP

Related Classes of org.springframework.cache.interceptor.CacheOperationInvoker

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.