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;
    }

 

相关文章:

  • 2021-09-11
  • 2022-03-01
  • 2021-07-16
  • 2022-12-23
  • 2021-08-25
  • 2022-12-23
  • 2022-03-07
猜你喜欢
  • 2021-11-28
  • 2021-08-14
  • 2022-01-15
  • 2021-04-23
  • 2022-12-23
  • 2021-06-20
  • 2021-09-03
相关资源
相似解决方案