1 Reply Latest reply on Jul 13, 2007 12:00 PM by Adrian Brock

    JBMICROCONT-99 Classloader for AbstractAnnotationMetaData to

    Kabir Khan Master

      We currently use the TCL to load up the annotation

       public Annotation getAnnotationInstance()
       {
       ...
       //FIXME [JBMICROCONT-99] [JBAOP-278] Use the loader for the bean?
       ann = (Annotation)AnnotationCreator.createAnnotation(annString, Thread.currentThread().getContextClassLoader());
       ...
       }
      


      Is this a correct assumption? Since this is called as part of the PreInstallAction, I am not sure if we have other choices at this stage?

        • 1. Re: JBMICROCONT-99 Classloader for AbstractAnnotationMetaDat
          Adrian Brock Master

          No. The api needs changing to pass in the classloader.

          You should be using:

          org.jboss.kernel.plugins.config.Configuration.getClassLoader(BeanMetaData)

          That method will return the TCL if there is nothing configured for the bean/deployment.

          It is a requirement that this works in PRE_INSTALL

          see AbstractClassLoaderMetaData

          
           public void initialVisit(MetaDataVisitor visitor)
           {
           visitor.setContextState(ControllerState.PRE_INSTALL);
           visitor.initialVisit(this);
           }