I have two classes
AbstractWorkFlow
ProductionWorkFlow
AbstractWorkFlow has fully implemented method executeWorkFlow which I haven’t overridden in ProductionWorkFlow.
Now I’m adding a Spring AOP to the ProductionWorkFlow.executeWorkFlow method.
<aop:pointcut id="businessService"
expression="execution(* ProductionWorkFlow.executeWorkFlow())" />
<aop:around pointcut-ref="businessService" method="log"/>
But even though executionWorkFlow is executed, my aspect doesn’t seem to be triggered. Any idea on this matter.
Try replacing the pointcut to be:
Your advice doesn’t match because, since
ProductionWorkFlowdoes not overrideexecuteWorkFlow,execution(* ProductionWorkFlow.executeWorkflow())does not exist.If you really want to advise only
ProductionWorkFlow, and not other implementations, then change it to: