最愛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
閱讀(377)
評論(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----彈出窗口(5602)
2.?ExtJs----Grid筆記(4794)
3.?ExtJs----拖放(3127)
4.?ExtJs----Ext支持的控件(2976)
5.?ExtJs----布局(2841)
評論排行榜
1.?《AspectJ Cookbook中文版》的附帶示例下載(12)
2.?插入排序思路與泛型版本的實現(4)
3.?歸并排序思路與泛型版本的實現(3)
4.?自編的"個人求職管理"小工具(2)
5.?《AspectJ Cookbook》讀書筆記四: 捕獲方法上的連接點(2)
Powered by:
BlogJava
Copyright © Brian
主站蜘蛛池模板:
国产做国产爱免费视频
|
亚洲日韩亚洲另类激情文学
|
在线视频亚洲一区
|
成全视频免费高清
|
亚洲国产精品张柏芝在线观看
|
日韩免费在线观看视频
|
在线亚洲精品自拍
|
久久WWW免费人成—看片
|
全黄大全大色全免费大片
|
亚洲一区二区三区乱码A
|
产传媒61国产免费
|
MM131亚洲国产美女久久
|
中文在线免费看视频
|
亚洲va中文字幕无码久久不卡
|
西西人体免费视频
|
亚洲网站在线免费观看
|
99精品国产免费久久久久久下载
|
日本亚洲精品色婷婷在线影院
|
成人超污免费网站在线看
|
久久亚洲精品无码gv
|
亚洲片国产一区一级在线观看
|
亚洲成人黄色网址
|
性做久久久久久久免费看
|
亚洲av色香蕉一区二区三区
|
亚洲国产综合久久天堂
|
中文字幕在线免费观看视频
|
亚洲电影国产一区
|
中国videos性高清免费
|
久久精品国产亚洲AV香蕉
|
久久久久久国产a免费观看黄色大片
|
亚洲私人无码综合久久网
|
亚洲国产精品综合久久网络
|
成人精品一区二区三区不卡免费看
|
久久亚洲精品国产精品
|
毛片A级毛片免费播放
|
亚洲黄片手机免费观看
|
亚洲成人在线免费观看
|
免费国产成人午夜私人影视
|
久久99青青精品免费观看
|
色五月五月丁香亚洲综合网
|
亚洲精品白浆高清久久久久久
|