Ah, I see

We do not differentiate between these two cases, and neither does the jvm.

You could try

  | <prepare expr="field(java.lang.String Super->superField"/>
  | </bind>
  | <bind pointcut="execution(B->new(..))">
  |    <interceptor name="AttachDynamicInterceptor"/>
  | </bind>
  | 

And then in AttachDynamicInterceptor do something like:


  | Object invoke(Invocation inv) throws Throwable{
  |    Object target = obj.invokeNext();
  |    Advised advised = (Advised)target;
  |    InstanceAdvisor ia = advised._getInstanceAdvisor();
  |    ia.insertInterceptor("X", new FieldInterceptor());
  |    
  |    return target;
  | }
  | 
  | 

This is a bit primitive though, since the FieldInterceptor will intercept 
everything that has been prepared on the new class. AOP 2.0 has more 
functionality in this area 
http://jboss.org/jbossBlog/blog/kkhan/2006/10/13/JBoss_AOP_2_0_alpha1_Released.txt

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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3999036
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to