[jboss-user] [JBoss AOP] - Re: Are names supposed to be unique in JBoss AOP?
flavia.rainone@jboss.com
do-not-reply at jboss.com
Wed Apr 9 16:07:24 EDT 2008
Hi again,
I have taken a deeper look at the code, and now I see that JBoss AOP does not generate another aspect class to represent the same interceptor. When the attribute name is ommitted, JBoss AOP names the AspectDefinition object after the class of the interceptor. I.e., the declaration below:
<bind pointcut="execution(* POJO$Bar->*(..))">
| <interceptor class="MethodInterceptor"/>
| </bind>
Will generate an AspectDefinition named "MethodInterceptor". When another binding with the same interceptor tag is found (and with the name attribute ommitted again), JBoss AOP looks for an AspectDefinition named "MethodInterceptor" instead of creating another AspectDefinition.
So, in the example you gave, JBoss AOP creates an AspectDefinition to represent SimpleInterceptor when it finds the first binding. When it finds the second one, it creates an AspectDefinition named MethodInterceptor. In the next bindings, it realizes it already has an AspectDefinition named MethodInterceptor and reuses this definition instead of creating extra AspectDefinitions.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4142970#4142970
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4142970
More information about the jboss-user
mailing list