4 Replies Latest reply on Jul 25, 2008 6:09 AM by adrian.brock

    Passing MetaData to AOPConstructorJoinPoint

      Kabir and I have come across an issue relating to how the MC and AOP
      negotiate the MetaData to use.
      http://www.jboss.com/index.html?module=bb&op=viewtopic&t=139625

      This solutions are getting pretty hacky, so I think we need to rethink how
      this api works.

      Basically being able to differentiate constructor calls that need to create AOP proxies
      and use Metadata vs other uses of ConstructorJoinPoints.

      Suggestions?

        • 1. Re: Passing MetaData to AOPConstructorJoinPoint

          Previously we had a bizarre method on BeanInfo/ClassAdapter
          which passed an opaque object (which was the MetaData)
          but this was also very hacky.

          Maybe we just need an extra method on the JoinpointFactory
          something like:

           /**
           * Get a constructor join point
           *
           * @param constructorInfo the constructor info
           * @param metaData an opaque object
           * @return the constructor join point
           * @throws JoinpointException when no such constructor
           */
           ConstructorJoinpoint getConstructorJoinpoint(ConstructorInfo constructorInfo, Object metaData) throws JoinpointException;
          


          which InstantiateAction can use to pass the MetaData instead of the MetaDataStack.

          This at least hides the ugliness from the main api and doesn't interfere with other uses
          fo ConstructorJoinpoints that use the original method.


          • 2. Re: Passing MetaData to AOPConstructorJoinPoint

            I've implemented my suggestion, so now the MetaData is passed
            explicitly to the constructor joinpoint when required.

            This means we no longer rely on the MetaDataStack to pass the MetaData
            (it's still there for other reasons), so there's no need to do the masking.

            • 3. Re: Passing MetaData to AOPConstructorJoinPoint

              I also changed the LazyInitializer to pass in MetaData object,
              but I don't know whether it works since I couldn't find a test for the AOP version?

              • 4. Re: Passing MetaData to AOPConstructorJoinPoint

                NOTE: Fixing this knocked off about 2-3 seconds on the JBoss bootstrap

                I doubt this was just caused by the spurious NoSuchMethodExceptions getting
                constructed, so it was showing a large overhead checking whether the JBossXB
                constructed objects needed AOP proxies.