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

kabir.khan@jboss.com do-not-reply at jboss.com
Thu Jan 4 11:39:27 EST 2007


"adrian at jboss.org" wrote : 
  | 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
  |   | 
  | 

I'm not really gettting this... I have found a way (not necessarily the best and final, but it works for my tests) to get hold of the context so I can get hold of the kernel. But for a bean annotated with "real" annotations as

  | @Test
  | public class AnnotatedChild extends Base
  | {
  | }
  | 

  |       Annotation[] ai = retrieval.retrieveAnnotations().getValue();
  |       Annotation[] ai2 = retrieval.retrieveLocalAnnotations().getValue();      
  |       Annotation[] anns = metaData.getAnnotations();
  | 
The ai, ai2 and anns all contain the same annotations. I

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

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



More information about the jboss-dev-forums mailing list