private <A extends Annotation> CacheMethodDetails<A> createMethodDetails(Method method, A annotation, String cacheName) { return new DefaultCacheMethodDetails<>(method, annotation, cacheName); }
private <A extends Annotation> CacheMethodDetails<A> createMethodDetails(Method method, A annotation, String cacheName) { return new DefaultCacheMethodDetails<>(method, annotation, cacheName); }
protected <A extends Annotation> CacheMethodDetails<A> create(Class<A> annotationType, Class<?> targetType, String methodName, Class<?>... parameterTypes) { Method method = ReflectionUtils.findMethod(targetType, methodName, parameterTypes); Assert.notNull(method, "requested method '" + methodName + "'does not exist"); A cacheAnnotation = method.getAnnotation(annotationType); return new DefaultCacheMethodDetails<>(method, cacheAnnotation, getCacheName(cacheAnnotation)); }
protected DefaultCacheInvocationContext<?> createDummyContext() throws Exception { Method method = Sample.class.getMethod("get", String.class); CacheResult cacheAnnotation = method.getAnnotation(CacheResult.class); CacheMethodDetails<CacheResult> methodDetails = new DefaultCacheMethodDetails<>(method, cacheAnnotation, "test"); CacheResultOperation operation = new CacheResultOperation(methodDetails, defaultCacheResolver, defaultKeyGenerator, defaultExceptionCacheResolver); return new DefaultCacheInvocationContext<>(operation, new Sample(), new Object[] {"id"}); }
private <A extends Annotation> CacheMethodDetails<A> createMethodDetails(Method method, A annotation, String cacheName) { return new DefaultCacheMethodDetails<A>(method, annotation, cacheName); }