[jboss-dev-forums] [Design of POJO Server] - Re: migrating TransactionManager and Invokers to POJO

kabir.khan@jboss.com do-not-reply at jboss.com
Wed Apr 2 16:13:28 EDT 2008


Having thought about it a bit, I don't like the @InstanceAnnotation from JBMDR-21. It works fine for the majority of cases where people use the lifecycle-configure stuff. BUT what if they for whatever reason also want to do things like


  | <bind execution="* @JMX->*(..)">
  |    <interceptor-ref name="JMXTrackingAspect"/>
  | </bind>
  | 

Then since the JMX annotation is ignored due to the @InstanceAnnotation annotation, no proxy is created.

I added the following to your test locally

  |   <interceptor xmlns="urn:jboss:aop-beans:1.0" class="org.jboss.test.microcontainer.beans.TestAspect"/>
  |   
  |   <bind xmlns="urn:jboss:aop-beans:1.0" pointcut="all(@org.jboss.test.microcontainer.support.ContainsIA2)">
  |     <advice aspect="org.jboss.test.microcontainer.beans.TestAspect" name="advice"/>
  |   </bind>
  | 
  |   <bean name="Bean7" class="org.jboss.test.microcontainer.support.SimpleBeanImpl">
  |     <annotation>@org.jboss.test.microcontainer.support.ContainsIA2</annotation>
  |   </bean>
  | 

@ContainsIA2 is similar to @ContainsIA. The test fails on

  |       assertIsAspectized("Bean7");
  | 

Bean7 should have a proxy. 

I don't think it is a good idea for the annotation to dictate the usage? I could add something to AOP to determine if the instance annotation actually ends up resulting in more aspects (not lifecycle callbacks), and if that is the case return a proxy? 

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

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



More information about the jboss-dev-forums mailing list