I started with an original question on Need help creating a specific pointcut that utilizes a value from a method annotation
I decided I wanted to ask another question to change the approach I was taking. I have a method (navigation), that has a call inside of that method to another method which I would like to have @Around advice.
@RequestMapping(method = RequestMethod.GET) public String navigation(ModelMap model) { ... // Call Auto Handling logger.info("Call AutoHandling"); this.processAutoHandling(callSession, FunctionalArea.PRE_MAIN_MENU); } ... return forward(returnView); } Is this possible as I cannot seem to get this to work if the method is inside of the same class.
This work if it was not on the object itself:
@Around("execution(* *.processAutoHandling(..)) &&" + "args(callSession, functionalArea) && " + "args(functionalArea) && " + "target(bean)" ) public Object processAutoHandlingCall2(ProceedingJoinPoint jp, CallSession callSession, FunctionalArea functionalArea, Object bean) throws Throwable { logger.debug("processAutoHandleCall"); return jp.proceed(); } With this call in my controller:
autoHandlingComponent.processAutoHandling(callSession, FunctionalArea.PRE_MAIN_MENU); instead of
this.processAutoHandling(callSession, FunctionalArea.PRE_MAIN_MENU);