日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

java能过吗_java – 你能通过例子解释AspectJ的cFlow(P u00...

發(fā)布時(shí)間:2023/12/19 编程问答 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 java能过吗_java – 你能通过例子解释AspectJ的cFlow(P u00... 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

Does it mean “get all join points that are in P, then add all join

points that are in Q, then match on anything that flows from any of

them”?

不,這意味著獲得P和Q中的所有連接點(diǎn),因此它是交叉點(diǎn).

Or does it mean “get all join points in P that are also in Q”, i.e.

all flow points within X() below?

是的,“獲得P中的所有連接點(diǎn)也在Q中”,其余部分則為“否”.原因是切入點(diǎn)P定義了一個(gè)連接點(diǎn):execution(void Example.P()),而切入點(diǎn)Q定義了一個(gè)連接點(diǎn):execution(void Example.Q()).因?yàn)檫@些連接點(diǎn)不同,所以它們的交集是空集.從空集中獲取的cflow也是一個(gè)空集.這就是為什么在AspectJ文檔中,這個(gè)切入點(diǎn)標(biāo)記為“不應(yīng)該發(fā)生”.

希望這可以幫助!

這是Power Point演示文稿中的一個(gè)誤導(dǎo)性引用:

cflow(P && Q) means that you first combine the pointcuts P and Q, and

all the join points flowing from that are in this collection

“combine”一詞應(yīng)改為“intersect”.

public class Example {

public void P() {

Q();

}

public void Q() {

}

public static void main(String[] args) {

new Example().P();

}

}

如果你運(yùn)行它,輸出應(yīng)該是這樣的:

pointcut: P join point: execution(Example.P())

pointcut: flowP join point: execution(Example.P())

pointcut: flowP join point: call(Example.Q())

pointcut: Q join point: execution(Example.Q())

pointcut: flowP join point: execution(Example.Q())

pointcut: flowQ join point: execution(Example.Q())

pointcut: flowPAndflowQ join point: execution(Example.Q())

這表明只有3個(gè)連接點(diǎn):

A: execution(Example.P())

B: call(Example.Q())

C: execution(Example.Q())

切入點(diǎn):

pointcut P includes only A

pointcut Q includes only C

pointcut flowP includes A, B and C

pointcut flowQ includes only C

pointcut flowPAndflowQ includes only C

我們現(xiàn)在可以看到P&& flow是一個(gè)空集,而flowP&& flowQ包括C.

我還包括了額外的切入點(diǎn):cflow(P()&& publicMethods())(這個(gè)切入點(diǎn)的建議在代碼中被注釋掉了). publicMethods()是執(zhí)行(public * *(..)).與cflow(P()&& Q())不同,它不會(huì)導(dǎo)致空集.

總結(jié)

以上是生活随笔為你收集整理的java能过吗_java – 你能通过例子解释AspectJ的cFlow(P u00...的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。