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

    隨筆分類

    隨筆檔案

    收藏夾

    搜索

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 亚洲一卡2卡三卡4卡无卡下载| 久久亚洲精品视频| 亚洲永久在线观看| 三年片在线观看免费大全| 亚洲第一永久在线观看| 人妻无码一区二区三区免费| 久久久久久亚洲av成人无码国产| 国产在线一区二区综合免费视频| 狠狠色伊人亚洲综合成人| 中文字幕免费在线看电影大全| 奇米影视亚洲春色| a成人毛片免费观看| 亚洲国产二区三区久久| 久久久久久精品成人免费图片| 久久久久亚洲Av无码专| 无码免费午夜福利片在线| 亚洲精品精华液一区二区| 国产在线98福利播放视频免费| 国产精品亚洲二区在线| 亚洲一区无码精品色| 老司机69精品成免费视频| 亚洲理论在线观看| 国产乱人免费视频| 久久国产美女免费观看精品| 亚洲一区二区成人| 国产在线不卡免费播放| 精精国产www视频在线观看免费| 亚洲欧洲日韩不卡| 扒开双腿猛进入爽爽免费视频 | 2017亚洲男人天堂一| 破了亲妺妺的处免费视频国产 | 中文文字幕文字幕亚洲色| 免费看无码自慰一区二区| 窝窝影视午夜看片免费| 午夜亚洲www湿好大| 思思re热免费精品视频66| 美女羞羞视频免费网站| 国产国拍亚洲精品mv在线观看| 青青青国产在线观看免费 | 亚洲成人午夜电影| 国产伦精品一区二区三区免费下载 |