1 Reply Latest reply on Oct 20, 2008 11:32 AM by alesj

    MicroContainer and JBoss AS5 Classloading

    emmartins

      I've been reading the MicroContainer (MC) user guide and have a few doubts regarding its integration in the AS 5.

      I've understood that by default a Pojo gets the MC deployer's thread classloader, and first question arises, is this one "associated" with the "old" NoAnnotationClassLoader and will share classes with the AS unified repository?

      What if I define my own classloader for the pojo, will this be interpreted as a scoped application (if now how is this accomplished)? In this case, how can I setup the scoped class loader to fetch classes not found from the AS unified repository?

      Thanks in advance,

      Eduardo

        • 1. Re: MicroContainer and JBoss AS5 Classloading
          alesj

           

          "emmartins" wrote:
          I've been reading the MicroContainer (MC) user guide and have a few doubts regarding its integration in the AS 5.

          And now you speak, after 3years of work. :-)

          "emmartins" wrote:

          I've understood that by default a Pojo gets the MC deployer's thread classloader

          True, see DeployerWrapper.
          But that's much better, since you at least know what you can expect from TCCL.

          "emmartins" wrote:
          , and first question arises, is this one "associated" with the "old" NoAnnotationClassLoader and will share classes with the AS unified repository?

          All CL in JBossAS has been re-written to use the new CL layer.
          See bootstrap.xml and its 'children'. So I doubt even bootstrap cl is NACL.
          And deployers are nothing else than pojos in MC, hence they also use the new cl layer.

          "emmartins" wrote:

          What if I define my own classloader for the pojo, will this be interpreted as a scoped application (if now how is this accomplished)?

          If you don't provide any additional info,
          things will behave as the old cl layer - import/export all.
          But new cl layer can mock OSGi kind of classloading,
          hence you can do fine grained scoping, OSGi style. ;-)

          "emmartins" wrote:
          In this case, how can I setup the scoped class loader to fetch classes not found from the AS unified repository?

          There are many different ways to do this.
          From KernelDeployment::classloader, BeanMetaData::classloader, jboss-classloading.xml, inlined classloading schema, ...