[jboss-user] [JBoss AOP] - Re: The use of the file

flavia.rainone@jboss.com do-not-reply at jboss.com
Wed Nov 12 12:02:35 EST 2008


"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.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4188860#4188860

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4188860



More information about the jboss-user mailing list