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
/** * 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.
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.
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?
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.