<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)

    隨筆分類

    隨筆檔案

    收藏夾

    搜索

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 亚洲13又紧又嫩又水多| 亚洲AV无码一区二区二三区软件| 国产1024精品视频专区免费| 18禁超污无遮挡无码免费网站国产| 午夜国产大片免费观看| 亚洲成AV人片在线观看ww| 国产精品亚洲四区在线观看| 深夜福利在线视频免费| 成年黄网站色大免费全看| 亚洲精品国产va在线观看蜜芽| 亚洲av午夜福利精品一区人妖| a级成人毛片免费视频高清| 好大好深好猛好爽视频免费| 亚洲色欲久久久综合网| 亚洲精华国产精华精华液| 91精品免费观看| 亚洲国产精品日韩专区AV| 亚洲日韩精品国产一区二区三区| 成在人线av无码免费高潮喷水 | a视频免费在线观看| 国产AV无码专区亚洲AV毛网站| 香港a毛片免费观看 | 亚洲一线产区二线产区区| 久操视频免费观看| 免费一级大黄特色大片| 456亚洲人成在线播放网站| 免费激情视频网站| 亚洲二区在线视频| 最近2018中文字幕免费视频| 精品日韩99亚洲的在线发布| 国产又大又黑又粗免费视频| 97se亚洲国产综合自在线 | 久久亚洲国产精品一区二区| 免费观看国产网址你懂的| 色播亚洲视频在线观看| a视频在线观看免费| 在线观看亚洲AV每日更新无码| 国产亚洲精品成人a v小说| 青青青视频免费观看| 免费在线一级毛片| 最近中文字幕高清免费中文字幕mv|