[jboss-user] [JBoss AOP] - Re: PER_INSTANCE and constructor executions, method calls, e

flavia.rainone@jboss.com do-not-reply at jboss.com
Fri Jul 27 19:25:31 EDT 2007


Hello, Paul

Actually, this behaviour is not a bug. Let me explain you why.

Put simply, a constructor doesn't occur inside an instance, it creates an instance. So, before the constructor execution, we don't have an instance available. And that's why we can't associate this execution to a PerInstanceAspect: we need to choose the per instance aspect equivalent to the instance that will be intercepted.

Regarding per instance interception on call joinpoints, the per instance aspect is currently being associated with the caller, and not the called. Given that the calls are being performed from inside a static method, the per instance interception doesn't take place.

To intercept constructor executions, I advise you to use a PerVM or a PerClass aspect.

I hope this helps.




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

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



More information about the jboss-user mailing list