<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 閱讀(374) 評論(0)  編輯  收藏 所屬分類: 《AspectJ Cookbook》讀書筆記

    公告


    導航

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

    統計

    常用鏈接

    留言簿(4)

    隨筆分類

    隨筆檔案

    收藏夾

    搜索

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 成人黄软件网18免费下载成人黄18免费视频| 国产一区视频在线免费观看| 99精品全国免费观看视频 | 亚洲国产综合人成综合网站| 亚洲精品无码你懂的| 午夜电影免费观看| 国产综合成人亚洲区| 亚洲av无码国产精品色在线看不卡| 九九精品国产亚洲AV日韩| 日本人护士免费xxxx视频| 久久综合亚洲色HEZYO国产| a一级爱做片免费| 亚洲日韩av无码| 久久青草免费91线频观看不卡| 亚洲美免无码中文字幕在线| 国产在线a免费观看| 亚洲国产成人综合精品| 3344免费播放观看视频| 亚洲国产成AV人天堂无码| 成人看的午夜免费毛片| 欧洲美女大片免费播放器视频| 黄页网站免费在线观看| 亚洲中文字幕一二三四区| 免费观看四虎精品国产永久| 一区二区三区免费在线观看| 日韩在线免费播放| 国产免费MV大全视频网站| 国产一精品一aⅴ一免费| 99re8这里有精品热视频免费| 亚洲AV福利天堂一区二区三| 无人视频在线观看免费播放影院| 亚洲色精品vr一区二区三区| 久久精品毛片免费观看| 亚洲变态另类一区二区三区 | 暖暖免费日本在线中文| 亚洲国产精品成人综合久久久| 久久一区二区三区免费播放 | 成**人免费一级毛片| jizz在线免费观看| 亚洲精品视频在线观看免费| 国产又大又长又粗又硬的免费视频|