第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

環(huán)繞通知加上后,advice最后的after和afterRetuning輸出順序問題

@沒加環(huán)繞通知的輸出:

MoocAspect before.

AspectBiz biz.

MoocAspect afterReturning.

MoocAspect after.


@加了環(huán)繞通知后的輸出:

MoocAspect before.

MoocAspect around 1.

AspectBiz biz.

MoocAspect around 2.

MoocAspect after.

MoocAspect afterReturning.


【溫馨提示:Java、Jsp、Android、JS等編程愛好者可以聯(lián)系Q:28554482,互相學(xué)習(xí),共同進(jìn)步!】

正在回答

2 回答

Spring官方的說法是,在同一個切面內(nèi),同類型(前/后)的通知順序是不確定的。因為通過反射確定類中聲明順序(這句話的意思,我也不理解)。

見官方文檔說明(同時給出了排序的建議):

When two pieces of advice defined in?the same?aspect both need to run at the same join point, the ordering is undefined (since there is no way to retrieve the declaration order via reflection for javac-compiled classes). Consider collapsing such advice methods into one advice method per join point in each aspect class, or refactor the pieces of advice into separate aspect classes - which can be ordered at the aspect level.


0 回復(fù) 有任何疑惑可以回復(fù)我~

我測試了下,發(fā)現(xiàn)當(dāng)有around配置時,after和afterReturning的執(zhí)行順序與他們在XML文件中配置的順序是相反的,原理我也沒有搞清楚。

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消

環(huán)繞通知加上后,advice最后的after和afterRetuning輸出順序問題

我要回答 關(guān)注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號