[jboss-dev-forums] [Design of AOP on JBoss (Aspects/JBoss)] - Re: Metadata rewrite

kabir.khan@jboss.com do-not-reply at jboss.com
Tue Dec 19 12:02:34 EST 2006


I've had a quick look and some of the aop-mc-int tests are failing. AFAICT we always have a MetaData passed in to AOP now, whereas before the presence of a MetaDataContext determined if we should create an instance proxy or not.

I have experimented with the following in AOPConstructorJoinPoint:

  |   ...
  |       MetaData metaData = MetaDataStack.peek();
  |       MetaDataStack.mask();
  |       try
  |       {
  | 
  |          MetaData md = getNonEmptyMetaData(metaData);
  |          ContainerCache cache = ContainerCache.initialise(manager, clazz, md);
  |   ...
  | 
  | 
  |    private MetaData getNonEmptyMetaData(MetaData metaData)
  |    {
  |       if (metaData == null)
  |       {
  |          return null;
  |       }
  |       
  |       if (metaData.getAnnotations() != MetaData.NO_ANNOTATIONS)
  |       {
  |          return metaData;
  |       }
  |       
  |       return null; 
  |    }
  | 

However, I have so far found 2 issues with this.

1) In the case of property annotations, the call to getAnnotations() returns NO_ANNOTATIONS. Where/how do I get hold of the property annotations? MetaData.getComponentMetaData() currently needs the signature as an argument. I could of course iterate over all the methods, and obtain the component metadata's for each of them, but am not sure if this is "clean" enough.

----- 
2) In the case of real annotations, e.g.
@Blah
class Test{}

@Blah is now part of the MetaData, and so I am wrongly creating an instance proxy.

-------
In other words I need a good way to determine the annotations, and to discover what level they come from. This in turn raises the question, what is the cutoff level for added metadata to cause an instance proxy to be created? 

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

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



More information about the jboss-dev-forums mailing list