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

adrian@jboss.org do-not-reply at jboss.com
Thu Dec 21 07:43:50 EST 2006


I'm not sure I understand the second part, but I understand the first part.

The answer to the final question is that the cutoff for creating an instance proxy
is whether it has instance annotations.
Obviouslly if there are server annotations (like default transaction timeout)
they will be shared by all instances.

The object you are getting is the MetaData (read only and merged)
which is the object that you should use in AOP.

However, this does not tell you if there are instance annotations.
What you really need to do is the following (pseudo code):


  | // Get the instance retrieval for this context
  | KernelMetaDataRepository repository = kernel.getMetaDataRepository();
  | MetaDataRetrieval retrieval = repository.getMetaDataRetrieval(context);
  | 
  | if (retrieval.isEmpty() == false)
  |    // Need an instance proxy
  | 

NOTE: obviously the "isEmpty()" doesn't exist
and it would need to check for annotations, object metadata and
component metadata as well.

But, you don't have a reference to the kernel or the context in the code
where you need to do this. I'm not sure what is the best way to solve this?

I don't like the idea of reintroducing the MetaData stuff into the BeanInfo
even the getDependencies(MetaData) is ugly.

That is unless it was implemented properly with the "InstanceClassInfo"
really holding the instance annotations, but that would probably require
a lot of rework in AOP to use the ClassInfo instead of Class or CtClass?

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

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



More information about the jboss-dev-forums mailing list