5 Replies Latest reply on Jul 12, 2007 1:50 PM by kabirkhan

    jca prototype broken again

      http://www.jboss.com/index.html?module=bb&op=viewtopic&t=102650&start=10

      Kabir you need which (if any) of those crappy factories that I wrote you are going to support.
      The only one we need to support is the one that deploys an aspect (in aop)
      with the same as the factory that constructs it (in the mc) so the dependencies work.

      I'd prefer it if you could deploy -aop.xml inside -bean.xml where it creates a
      BeanMetaDataFactory and the pojos constructed maintain the aop metadata.
      But that's up-to-you. It would be a nice to have.
      http://jira.jboss.com/jira/browse/JBAOP-237

        • 1. Re: jca prototype broken again

          This has actually got a whole easier with the new support that I wrote for JAXB
          annotation constructions of JBossXB schemas and Ales's BeanMetaData builder.

          e.g. something like, this part of an mc deployment

          <deployment>
           <queue xmlns="urn:jboss-jms-2.0" name="MyQueue"/>
          </deployment>
          


          can be parsed with
          @XmlSchema(namespace="urn:jboss-jms:2.0")
          @XmlType(name="queue")
          public QueueMetaData implements BeanMetaDataFactory{
          
           @XmlAttribute public String name;
          
           List<BeanMetaData> getBeans() {
           Collections.singletonList(
           new BeanMetaDataBuilder(name, Queue.class.getName()).
           addProperty("queueName", name));
           }
          }
          


          Plus a piece of registration so it knows QueueMetaData exists as a potential "schema".


          • 2. Re: jca prototype broken again
            kabirkhan

            I've reproduced the NPE in the aop tests, and am working on a fix. I'll update the aop snapshot later today.

            I'm not really groking the rest of what you are mentioning?

            • 3. Re: jca prototype broken again

              Look at aop-mc-int - org.jboss.aop.microcontainer.beans

              This needs doing properly and deciding what is really supported.
              These are only really used by the jca prototype at the moment.

              I'd prefer it instead of doing

              
               <bean name="ConnectionManagerBinding" class="org.jboss.aop.microcontainer.beans.StackBinding">
               <property name="pointcut">execution(* $instanceof{javax.resource.spi.ConnectionManager}->*(..))</property>
               <property name="manager"><inject bean="AspectManager"/></property>
               <property name="advices">
               <list>
               <inject bean="TraceAspect" property="definition"/>
               <inject bean="ExceptionAspect" property="definition"/>
               <inject bean="SecurityAspect" property="definition"/>
               <inject bean="PoolAspect" property="definition"/>
               <inject bean="ListenerAspect" property="definition"/>
               </list>
               </property>
               </bean>
              


              You could use the equivalent aop config in the -beans.xml

              i.e. it would hit the aop schema in the xml,
              use aop parser to create a BeanMetaDataFactory like the example I posted above
              about creating a queue for jms.
              The BeanMetaDataFactory would then internally generate the equivalent
              BeanMetaData as the example I posted above.

              e.g. psuedo code (I haven't looked up what the real aop config is or whether it even exists :-)
              <aop-stack xmlns="urn:jboss.aop:aop-mc-deployer">
               <pointcut>...</pointcut>
               <aspect-list>
               <aspect>TraceAspect</aspect>
               <aspect>ExecutionAspect</aspect>
               etc.
              </aop-stack>
              


              would generate the same BeanMetaData as the one above,
              but without all the junk, e.g. knowing what the internal bean and property names are.

              • 4. Re: jca prototype broken again
                kabirkhan

                It is much clearer now, thanks

                • 5. Re: jca prototype broken again
                  kabirkhan

                  I've updated the aop snapshot in the old repository, and will do so to the maven repository once I figure out what is going wrong with my current attempts