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

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

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

    最愛Java

    書山有路勤為徑,學(xué)海無涯苦作舟

    《AspectJ Cookbook》讀書筆記六: 捕獲通知上的連接點(diǎn)

    一. 捕獲何時(shí)執(zhí)行通知
            
    使用adviceexecution()切入點(diǎn)。adviceexecution()切入點(diǎn)的語法如下:
            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(
             
    "------------------------------------------------------------");
       }

    }


    二. 排出作為通知執(zhí)行結(jié)果的連接點(diǎn)
    三. 在發(fā)出通知時(shí)展示原始連接點(diǎn)
            
    添加JoinPoint標(biāo)識(shí)符到切入點(diǎn)定義中。
    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) 評(píng)論(0)  編輯  收藏 所屬分類: 《AspectJ Cookbook》讀書筆記

    公告


    導(dǎo)航

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

    統(tǒng)計(jì)

    常用鏈接

    留言簿(4)

    隨筆分類

    隨筆檔案

    收藏夾

    搜索

    最新評(píng)論

    閱讀排行榜

    評(píng)論排行榜

    主站蜘蛛池模板: 亚洲国产综合精品中文第一| 亚洲国产成人精品女人久久久 | 日本系列1页亚洲系列| 6080午夜一级毛片免费看| 亚洲V无码一区二区三区四区观看| 一个人免费观看日本www视频| 亚洲日韩中文在线精品第一| 人成电影网在线观看免费| 久久精品亚洲男人的天堂| 羞羞视频免费网站在线看| 久久精品国产亚洲沈樵| 久久精品视频免费看| 亚洲精品在线网站| 三年片在线观看免费观看高清电影| 亚洲免费在线视频观看| 高清国语自产拍免费视频国产 | 性做久久久久免费看| 黄色免费网址大全| 中文字幕亚洲无线码| 久久青草免费91线频观看站街| 亚洲黄色在线观看网站| 福利免费观看午夜体检区| 狼人大香伊蕉国产WWW亚洲| 亚洲综合色视频在线观看| 无码日韩精品一区二区免费暖暖| 亚洲视频免费播放| 成人免费视频国产| 青青操在线免费观看| 亚洲午夜电影一区二区三区| 日本免费一二区在线电影| 国产精品成人啪精品视频免费| 亚洲动漫精品无码av天堂| 美女视频黄的全免费视频网站| 亚洲AV日韩AV一区二区三曲| 久久亚洲欧洲国产综合| 毛片免费全部播放无码| 青娱乐在线免费观看视频| 亚洲国产精品久久久久网站 | 午夜亚洲av永久无码精品| 久久w5ww成w人免费| jlzzjlzz亚洲乱熟在线播放|