3 Replies Latest reply on Feb 12, 2008 8:55 AM by gcompienne

    Questions on describe/classloader deployers and CL scope

      I have a few questions the concerning the DESCRIBE and CLASSLOADER deployer stages.

      I understand the principle that DESCRIBE is used to declare/define the dependencies whilst the CLASSLOADER stage is related to the classloader itself.

      I have noticed that the classloader instance (BaseClassLoader) is created in-between the DESCRIBE and CLASSLOADER stages. That's seems reasonable as after the DESCRIBE stage I suspect the system should have enough information to create the appriopriate classloader. But then I wonder what is really the purpose of the CLASSLOADER stage? Is it to have a deployer that will create the classloader itself? If so, how do I make that happen (as I said the CL is currently automatically created between the describe and classloader stages).

      I also have another question concerning classloaders. Looking at the MC code it looks like the classloader is only created for a top level deployment unit. Why is that the case? (it would mean the WAR, JAR and other would use the CL of the EAR). Does it has to be always the case? Or am I missing something?

      Thanks.

      Gilles.

        • 1. Re: Questions on describe/classloader deployers and CL scope
          alesj

           

          "gcompienne" wrote:
          I have a few questions the concerning the DESCRIBE and CLASSLOADER deployer stages.

          I understand the principle that DESCRIBE is used to declare/define the dependencies whilst the CLASSLOADER stage is related to the classloader itself.

          I have noticed that the classloader instance (BaseClassLoader) is created in-between the DESCRIBE and CLASSLOADER stages. That's seems reasonable as after the DESCRIBE stage I suspect the system should have enough information to create the appriopriate classloader. But then I wonder what is really the purpose of the CLASSLOADER stage? Is it to have a deployer that will create the classloader itself? If so, how do I make that happen (as I said the CL is currently automatically created between the describe and classloader stages).

          Where do you see it getting created?
          Since it's the AbstractTopLevelClassLoaderSystemDeployer that does this in AS5 --> VFSTopLevelClassLoaderSystemDeployer, and its stage is CLASSLOADER.

          "gcompienne" wrote:

          I also have another question concerning classloaders. Looking at the MC code it looks like the classloader is only created for a top level deployment unit. Why is that the case? (it would mean the WAR, JAR and other would use the CL of the EAR). Does it has to be always the case? Or am I missing something?

          You're missing AbstractClassLoaderSystemDeployer. ;-)
          This one has no notion of top level deployment.
          Currently used by WarClassLoaderDeployer (although soon to be depracated -- see top comment in this class).




          • 2. Re: Questions on describe/classloader deployers and CL scope

             


            Where do you see it getting created?
            Since it's the AbstractTopLevelClassLoaderSystemDeployer that does this in AS5 --> VFSTopLevelClassLoaderSystemDeployer, and its stage is CLASSLOADER.


            Ok, so I suspect the problem I am getting is the fact that the BaseClassLoader is created by the VFSTopLevelClassLoaderSystemDeployer before my CL deployer gets called (logical as the system one was loaded first).

            That is interesting. In my case, ideally, I would not want to have to change the conf/bootstrap-beans.xml to change the order of the deployers and insert mine.

            So is there a way that at the describe stage I could provide enough information to tell the VFSTopLevelClassLoaderSystemDeployer not to kick in yet or change the order they will be prioritized? (input, outputs would be one way, and I am wondering: should I try to remove/relocate the input needed by VFSTopLevelClassLoaderSystemDeployer to work...?).

            Thanks.

            Gilles.

            • 3. Re: Questions on describe/classloader deployers and CL scope

              Ok, don't bother replying to my question yet: I am currently looking at WarClassLoaderDeployer and it looks like it will hold the answers to my questions.