Hi,

I feel that this may be a known issue, which is already in somebody's
todo list. Sorry if it is so, but I still hope to get some reply.
Now jBoss creates one URLClassLoader per jar file (may I call it
"container ClassLoader"?) and then creates one BeanClassLoader per
bean, i.e. multiple BeanClassLoaders for each container ClassLoader.
Comments in BeanClassLoader.java state:
 "This classloader is used to hold the java: JNDI-namespace root.
  Each container has its own BCL. When a "java:" lookup is made
  the JNDI-provider will use the root to lookup the values."
The phrase "Each container has its own BCL" is not the full truth:
each container has one or more own BCLs.
I think it's a bit strange use of ClassLoaders: BeanClassLoader add
nothing to the classpath, but instead serves for JNDI-provider.
Isn't it possible to use ThreadLocal variable instead?
Say, put to it a HashMap containing all JNDI entries for the given
bean. Am I missing something?

Best regards,
 Oleg Nitz    



Reply via email to