<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    最愛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》讀書筆記

    公告


    導航

    <2008年8月>
    272829303112
    3456789
    10111213141516
    17181920212223
    24252627282930
    31123456

    統計

    常用鏈接

    留言簿(4)

    隨筆分類

    隨筆檔案

    收藏夾

    搜索

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 国产做国产爱免费视频| 亚洲日韩亚洲另类激情文学| 在线视频亚洲一区| 成全视频免费高清| 亚洲国产精品张柏芝在线观看| 日韩免费在线观看视频| 在线亚洲精品自拍| 久久WWW免费人成—看片| 全黄大全大色全免费大片| 亚洲一区二区三区乱码A| 产传媒61国产免费| MM131亚洲国产美女久久| 中文在线免费看视频| 亚洲va中文字幕无码久久不卡| 西西人体免费视频| 亚洲网站在线免费观看| 99精品国产免费久久久久久下载| 日本亚洲精品色婷婷在线影院| 成人超污免费网站在线看| 久久亚洲精品无码gv| 亚洲片国产一区一级在线观看 | 亚洲成人黄色网址| 性做久久久久久久免费看| 亚洲av色香蕉一区二区三区| 亚洲国产综合久久天堂| 中文字幕在线免费观看视频| 亚洲电影国产一区| 中国videos性高清免费| 久久精品国产亚洲AV香蕉| 久久久久久国产a免费观看黄色大片| 亚洲私人无码综合久久网| 亚洲国产精品综合久久网络| 成人精品一区二区三区不卡免费看| 久久亚洲精品国产精品| 毛片A级毛片免费播放| 亚洲黄片手机免费观看| 亚洲成人在线免费观看| 免费国产成人午夜私人影视| 久久99青青精品免费观看| 色五月五月丁香亚洲综合网| 亚洲精品白浆高清久久久久久|