[jboss-dev-forums] [Design the new POJO MicroContainer] - Adding annotations to MDR via bean metadata

kabir.khan@jboss.com do-not-reply at jboss.com
Tue Aug 18 09:05:32 EDT 2009


I am creating a bean metadata with some annotations added

  |       AbstractBeanMetaData metaData = new AbstractBeanMetaData("McBean", McBeanAnnotationsFromMetaData.class.getName());
  |       metaData.setAccessMode(BeanAccessMode.ALL);
  |       
  |       AbstractConstructorMetaData ctor = new AbstractConstructorMetaData();
  |       AnnotationMetaData initializer = new AbstractAnnotationMetaData("@" + Initializer.class.getName());
  |       ctor.setAnnotations(Collections.singleton(initializer));
  |       metaData.setConstructor(ctor);
  | 

I create a KCC from that and deploy it. When I read the metadata from my describe action there are no annotations in the metadata:


  |    private AnnotatedType<T> createMdrDecoratedAnnotatedType(Class<T> clazz)
  |    {
  |       AnnotatedType<T> type = context.getManager().createAnnotatedType(clazz);
  | 
  |       KernelController controller = (KernelController)context.getController();
  |       Kernel kernel = controller.getKernel();
  |       KernelMetaDataRepository repository = kernel.getMetaDataRepository();
  |       MetaData metaData = repository.getMetaData(context);
  |       
  |       return MDRAnnotatedTypeFactory.getInstance().getAnnotatedType(type, metaData);
  |    }
  | 
  | 
Am I adding them wrong?

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

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



More information about the jboss-dev-forums mailing list