* @throws Throwable
* any exception thrown when executing the intercepted method
*/
public final Object invoke(MethodInvocation methodInvocation)
throws Throwable {
FlushingModel model = getModel(methodInvocation);
if (null == model) {
logger.info("Unable to flush cache. "
+ "No model is associated to the intercepted method");
return methodInvocation.proceed();
}
Object proceedReturnValue = null;
if (model.flushBeforeMethodExecution()) {
cacheProviderFacade.flushCache(model);
proceedReturnValue = methodInvocation.proceed();
} else {
proceedReturnValue = methodInvocation.proceed();