1 Reply Latest reply on Nov 12, 2008 12:02 PM by flavia.rainone

    The use of the file "jboss-aop.xml"

    hou84

      Hello,
      My question is: When I use under the file "jboss-aop.xml" the tag "bind pointcut" I use dynamic AOP, or we couldn't considerate that I use "dynamic AOP" only in the case I use "HotDeployment" and "hotSwapping"?
      Thank you a lot.

        • 1. Re: The use of the file
          flavia.rainone

           

          "hou84" wrote:

          When I use under the file "jboss-aop.xml" the tag "bind pointcut" I use dynamic AOP


          Hi! Nope, you are not using dynamic AOP. Dynamic AOP is when you add and/or remove aspects at runtime. You can do this by hot deployment (available only in AS) or by using our dynamic AOP API (methods addBinding and removeBinding of class AspectManager). You can also do this by deploying and undeploying aspects using the AspectXMLLoader class methods:

          
          public class AspectXMLLoader
          {
           // lots of other stuff
           ...
          
           // will deploy the *-aop.xml file that is located in url,
           // adding at runtime all the bindings and aspects you declared in this file
           public static void deployXML(URL url) throws Exception
          
           // will undo the operation performed by the previous operation
           public static void undeployXML(URL url) throws Exception
          


          When you add or remove aspects at runtime without hotswap enabled, JBoss AOP will insert hooks in your code before your classes get loaded. So, there will be empty calls to aspects on the joinpoints, including those are not being intercepted, which can cause some delay. But it is still dynamic AOP.

          If you use dynamic aop with hotswap enabled, then your code runs without changes in its control flow. Your code will be changed only after you add an aspect and it will be changed only in the points that are affected by that aspect. If you remove that aspect, your code will return to its previous form, again, without performance impact.

          We are on an effort to improve our documentation and API. So, you should see a complete documentation on this in the near future.