aop学习总结三----aop的相关概念
aop学习总结三----aop的相关概念
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {//环绕通知 PersonServiceBean bean = (PersonServiceBean) this.targetObject; Object result = null; if(bean.getUser()!=null){ //beforeadvice()-->前置通知 try { result = method.invoke(targetObject, args); // afteradvice() -->后置通知 } catch (RuntimeException e) { //exceptionadvice()--> 例外通知 }finally{ //finallyadvice(); -->最终通知 } } return result; }