class CacheInvocationContextFactory {

    public static CacheInvocationContext<CacheResult> createCacheResultInvocationContext(MetaHolder metaHolder) {
        Method method = metaHolder.getMethod();
        if (method.isAnnotationPresent(CacheResult.class)) {
            CacheResult cacheResult = method.getAnnotation(CacheResult.class);
            MethodExecutionAction cacheKeyMethod = createCacheKeyAction(cacheResult.cacheKeyMethod(), metaHolder);
            return new CacheInvocationContext<CacheResult>(cacheResult, cacheKeyMethod, metaHolder.getObj(), method, metaHolder.getArgs());
        }
        return null;
    }

}