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

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

對(duì)切面和切入點(diǎn)的理解

<aop:config>
????<aop:aspect?id="myAspect"?ref="aBean">
????<aop:pointcut?expression="execution(*?com.imooc.aop.schema.advice.biz.*Biz.*(..))"?id="moocPointcut"?/>
????<aop:before?method="before"?pointcut-ref="moocPointcut"?/>?//前置通知
????<aop:after-returning?method="afterReturning"?pointcut-ref="moocPointcut"?/>?//返回后通知
????<aop:after-throwing?method="afterThrowing"?pointcut-ref="moocPointcut"?/>?//拋出異常后通知
????<aop:after?method="after"?pointcut-ref="moocPointcut"?/>?//后通知
????</aop:aspect>
</aop:config>

aspect引用的類aBean相當(dāng)于一個(gè)切面,里面提供處理切入點(diǎn)的方法,pointcut里的expression相當(dāng)于一個(gè)生產(chǎn)線,里面的各個(gè)方法就相當(dāng)于生產(chǎn)線的切入點(diǎn)。之后的after,after-throwing,before相當(dāng)于不同切入點(diǎn)的工人,通過(guò)ponitcut-ref到指定切入點(diǎn)工作,只不過(guò)工作時(shí)間順序不同,分別在切入點(diǎn)后,出問題后,切入點(diǎn)前,method表示程序順著生產(chǎn)線到切入點(diǎn)時(shí)各個(gè)工人用切入面的方法處理。

正在回答

1 回答

寫的挺好的,理解感覺也挺生動(dòng)。

定義了一個(gè)方面,每個(gè)方面會(huì)有若干點(diǎn),每個(gè)點(diǎn)都可以設(shè)置在什么時(shí)候觸發(fā)這個(gè)點(diǎn)開始工作,分別可以設(shè)置在這個(gè)點(diǎn)發(fā)生的事件之前、之后、返回前、拋出異常之前。同時(shí)也設(shè)置了各個(gè)方法,一點(diǎn)觸發(fā)就到對(duì)應(yīng)的方法中執(zhí)行相應(yīng)的操作。

總體感覺大概就是這個(gè)意思。

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

舉報(bào)

0/150
提交
取消

對(duì)切面和切入點(diǎn)的理解

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

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

幫助反饋 APP下載

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

公眾號(hào)

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