}
final CacheKeyInvocationContext<CachePut> cacheKeyInvocationContext = contextFactory.getCacheKeyInvocationContext(invocationContext);
final CacheKeyGenerator cacheKeyGenerator = cacheKeyInvocationContext.unwrap(CacheKeyInvocationContextImpl.class).getCacheKeyGenerator();
final CachePut cachePut = cacheKeyInvocationContext.getCacheAnnotation();
final CacheKey cacheKey = cacheKeyGenerator.generateCacheKey(cacheKeyInvocationContext);
final Cache<CacheKey, Object> cache = cacheResolver.resolveCache(cacheKeyInvocationContext);
final Object valueToCache = cacheKeyInvocationContext.getValueParameter().getValue();
if (!cachePut.afterInvocation() && valueToCache != null) {