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

flavia.rainone@jboss.com do-not-reply at jboss.com
Tue Oct 28 16:18:03 EDT 2008


Well, if POJO is being intercepted by SimpleInterceptor, the jboss-aop.xml file is being loaded.

What do you mean with modifying SimpleInterceptor by InstanceInterceptor?

You can only modify something through the code, like below:

public static void main(String[] args) throws Exception
  |    {
  |       // using SimpleInterceptor
  |       AdviceBinding binding = new AdviceBinding("execution(public * POJO->someMethod(..))", null);
  |       binding.addInterceptor(SimpleInterceptor.class);
  |       AspectManager.instance().addBinding(binding);
  |       // check: SimpleInterceptor is being used
  |       execute();
  | 
  |       // modifying binding, now I want to use InstanceInterceptor
  |      AdviceBinding newBinding = new AdviceBinding(binding.getName(), "execution(public * POJO->someMethod(..))", null);
  |       newBinding.addInterceptor(InstanceInterceptor.class);
  |       AspectManager.instance().addBinding(newBinding);
  |       // check: Instanceinterceptor is now being used
  |       execute();
  | 
  |    }	

At the moment that you use the name of the old binding in the new binding (at the line that calls the AdviceBinding constructor passing binding.getName() as parameter), you are replacing binding by newBinding. Consequently, you are replacing SimpleInterceptor by InstanceInterceptor.



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

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



More information about the jboss-user mailing list