最愛Java
書山有路勤為徑,學海無涯苦作舟
《AspectJ Cookbook》讀書筆記六: 捕獲通知上的連接點
一. 捕獲何時執行通知
使用adviceexecution()切入點。adviceexecution()切入點的語法如下:
pointcut <pointcut name>() : adviceexecution();
package
com.aspectj;
public
aspect AdviceExecutionRecipe
{
/**/
/*
Specifies calling advice whenever advice is executed
*/
pointcut adviceExecutionPointcut() : adviceexecution();
//
Advice declaration
before() : adviceExecutionPointcut()
{
System.out.println(
"
------------------- Aspect Advice Logic --------------------
"
);
System.out.println(
"
In the advice picked by ExecutionRecipe
"
);
System.out.println(
"
Signature:
"
+
thisJoinPoint.getStaticPart().getSignature());
System.out.println(
"
Source Line:
"
+
thisJoinPoint.getStaticPart().getSourceLocation());
System.out.println(
"
------------------------------------------------------------
"
);
}
}
二. 排出作為通知執行結果的連接點
三. 在發出通知時展示原始連接點
添加JoinPoint標識符到切入點定義中。
package
com.aspectj;
import
org.aspectj.lang.JoinPoint;
public
aspect AdviceExecutionRecipe
{
/**/
/*
Specifies calling advice whenever advice is executed
*/
pointcut adviceExecutionPointcut(JoinPoint originalJoinPoint) : adviceexecution()
&&
args(originalJoinPoint)
&&
!
within(AdviceExecutionRecipe);
//
Advice declaration
before(JoinPoint originalJoinPoint) : adviceExecutionPointcut(originalJoinPoint)
{
System.out.println(
"
------------------- Aspect Advice Logic --------------------
"
);
System.out.println(
"
In the advice picked by AdviceExecutionRecipe
"
);
System.out.println(
"
Signature:
"
+
thisJoinPoint.getStaticPart().getSignature());
System.out.println(
"
Source Line:
"
+
thisJoinPoint.getStaticPart().getSourceLocation());
System.out.println(
"
Advised Advice's Join Point Signature:
"
+
originalJoinPoint.getSignature());
System.out.println(
"
------------------------------------------------------------
"
);
}
}
posted on 2008-08-29 16:09
Brian
閱讀(374)
評論(0)
編輯
收藏
所屬分類:
《AspectJ Cookbook》讀書筆記
新用戶注冊
刷新評論列表
只有注冊用戶
登錄
后才能發表評論。
網站導航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
相關文章:
《AspectJ Cookbook中文版》的附帶示例下載
《AspectJ Cookbook》讀書筆記六: 捕獲通知上的連接點
《AspectJ Cookbook》讀書筆記二十二: 應用企業級方面
《AspectJ Cookbook》讀書筆記二十一: 應用應用程序級方面
《AspectJ Cookbook》讀書筆記二十: 應用類和組件級方面
《AspectJ Cookbook》讀書筆記十九: 實現行為型面向對象設計模式
《AspectJ Cookbook》讀書筆記十八: 實現結構型面向對象設計模式
《AspectJ Cookbook》讀書筆記十七: 實現創建型面向對象設計模式
《AspectJ Cookbook》讀書筆記十六: 增強類和編譯器
《AspectJ Cookbook》讀書筆記十五: 定義方面的關系
公告
導航
BlogJava
首頁
新隨筆
聯系
聚合
管理
<
2008年8月
>
日
一
二
三
四
五
六
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
統計
隨筆 - 52
文章 - 0
評論 - 34
引用 - 0
常用鏈接
我的隨筆
我的評論
我的參與
最新評論
留言簿
(4)
給我留言
查看公開留言
查看私人留言
隨筆分類
《AspectJ Cookbook》讀書筆記(24)
(rss)
EXTJS(1)
(rss)
Jakarta Commons筆記(3)
(rss)
JScript(11)
(rss)
Struts2(4)
(rss)
數據結構與算法(2)
(rss)
自編小工具(1)
(rss)
隨筆檔案
2010年11月 (2)
2010年10月 (2)
2009年10月 (13)
2009年1月 (3)
2008年12月 (1)
2008年8月 (18)
2008年7月 (2)
2008年6月 (4)
收藏夾
Java中的字符集編碼入門(6)
(rss)
搜索
最新評論
1.?re: Struts2學習筆記——輸入校驗(二)
ValidatorType.FIELD是什么意思呢?
--caipc
2.?re: ExtJs----彈出窗口
dsfsdfsdfsdf
--dgd
3.?re: javascript面向對象技術基礎(二)
@zx
什么意思?
--cxs
4.?re: javascript面向對象技術基礎(二)
rtwtwatwatst
--zx
5.?re: 《AspectJ Cookbook中文版》的附帶示例下載[未登錄]
謝謝
--jacky
閱讀排行榜
1.?ExtJs----彈出窗口(5592)
2.?ExtJs----Grid筆記(4777)
3.?ExtJs----拖放(3119)
4.?ExtJs----Ext支持的控件(2967)
5.?ExtJs----布局(2833)
評論排行榜
1.?《AspectJ Cookbook中文版》的附帶示例下載(12)
2.?插入排序思路與泛型版本的實現(4)
3.?歸并排序思路與泛型版本的實現(3)
4.?自編的"個人求職管理"小工具(2)
5.?《AspectJ Cookbook》讀書筆記四: 捕獲方法上的連接點(2)
Powered by:
BlogJava
Copyright © Brian
主站蜘蛛池模板:
成人黄软件网18免费下载成人黄18免费视频
|
国产一区视频在线免费观看
|
99精品全国免费观看视频
|
亚洲国产综合人成综合网站
|
亚洲精品无码你懂的
|
午夜电影免费观看
|
国产综合成人亚洲区
|
亚洲av无码国产精品色在线看不卡
|
九九精品国产亚洲AV日韩
|
日本人护士免费xxxx视频
|
久久综合亚洲色HEZYO国产
|
a一级爱做片免费
|
亚洲日韩av无码
|
久久青草免费91线频观看不卡
|
亚洲美免无码中文字幕在线
|
国产在线a免费观看
|
亚洲国产成人综合精品
|
3344免费播放观看视频
|
亚洲国产成AV人天堂无码
|
成人看的午夜免费毛片
|
欧洲美女大片免费播放器视频
|
黄页网站免费在线观看
|
亚洲中文字幕一二三四区
|
免费观看四虎精品国产永久
|
一区二区三区免费在线观看
|
日韩在线免费播放
|
国产免费MV大全视频网站
|
国产一精品一aⅴ一免费
|
99re8这里有精品热视频免费
|
亚洲AV福利天堂一区二区三
|
无人视频在线观看免费播放影院
|
亚洲色精品vr一区二区三区
|
久久精品毛片免费观看
|
亚洲变态另类一区二区三区
|
暖暖免费日本在线中文
|
亚洲国产精品成人综合久久久
|
久久一区二区三区免费播放
|
成**人免费一级毛片
|
jizz在线免费观看
|
亚洲精品视频在线观看免费
|
国产又大又长又粗又硬的免费视频
|