There are still container specific loaders for every container.  The line of
code under discussion was creating another application level classloader
which is a duplicate of the one created in J2eeDeployer and which will never
be used for anything.

The container-specific classloaders are created on line 723 of
ContainerFactory.java:
   container.setClassLoader( new URLClassLoader( new URL[ 0 ], cl ) );

Currently the classloader stack looks like:

0. bootstrap loader

...

1. Jboss classloader (MLoading: sees the stuff in lib/ext)

2. App classloader (URLClassLoader: created in J2eeDeployer: sees ejb-jars
and shared libs: delegates to #1: loads all application classes except the
ones in the war file:  passed to tomcat and to ContainerFactory)

3. App classloader (URLClassLoader: created in ContainerFactory: sees
ejb-jars: loads nothing because it delegates to #2.)

4. Container classloader (URLClassLoader: created in ContainerFactory: sees
nothing: delegates to #3: used to identify container)

5. Container local classloader (URLClassLoader: created in ContainerFactory:
sees local ejb-jar: does not delegate: loads local xml descriptors)

6. Tomcat servlet classloader (AdaptiveClassLoader: created by Tomcat: sees
war file: delegates to #2: loads classes from war file)

My change was just to eliminate #3, since it doesn't do anything.  We
already have classloaders stacked 4-deep, I didn't see any reason to add
another gratuitously.

Anyway, its not that Important, I just thought Id explain since people
seemed unclear on what was going on.

dave

> -----Original Message-----
> From: Scott M Stark [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 23, 2001 3:38 PM
> To: JBoss-Dev
> Cc: Castro, David
> Subject: Re: [jBoss-Dev] CVS update: jboss/src/main/org/jboss/ejb
> ContainerFactory.java
> 
> 
> I believe there is a difference in terms of the JNDI 
> namespace isolation between
> containers and so there is utility in the container specific 
> class loader. I want to
> really drill down on the current container/class 
> loader/namespace relationships
> and get this well documented and understood as it affects 
> many layers. I'm going
> to put together something this weekend and submit it for 
> corrections and additions
> next week.
> 
> ----- Original Message ----- 
> From: "Castro, David" <[EMAIL PROTECTED]>
> To: "'JBoss-Dev'" <[EMAIL PROTECTED]>
> Sent: Friday, February 23, 2001 12:31 PM
> Subject: RE: [jBoss-Dev] CVS update: 
> jboss/src/main/org/jboss/ejb Containe rFactory.java
> 
> 
> > It will work this way, too - it just seems pointless to add 
> yet another
> > extraneous layer to the ClassLoader stack.
> > 
> > You know, Marc, I do research and test this stuff before I 
> send it in.  And
> > yes, I do understand how the shared classloaders work.
> > 
> > hope that didn't sound too snotty :)
> > dave
> > 
> 
> 





---------------------------------------------------------------------
This message (including any attachments) contains confidential, proprietary
or privileged information intended for a specific purpose and individual(s),
and is protected by law.  If you receive this message in error, please
immediately delete it and all copies of it from your system, destroy any
hard copies of it and notify the sender.  Any unauthorized disclosure,
copying or distribution of any part of this message, or the taking of any
unauthorized action based on it, is strictly prohibited.

Reply via email to