final CacheKeyInvocationContext<CacheRemoveAll> cacheKeyInvocationContext =
contextFactory.getCacheKeyInvocationContext(invocationContext);
final CacheRemoveAll cacheRemoveAll = cacheKeyInvocationContext.getCacheAnnotation();
final Cache<GeneratedCacheKey, Object> cache = cacheResolver.resolveCache(cacheKeyInvocationContext);
if (!cacheRemoveAll.afterInvocation()) {
cache.clear();
if (getLog().isTraceEnabled()) {
getLog().tracef("Clear cache '%s' before method invocation", cache.getName());
}
}