aspose file tools*
The moose likes Java in General and the fly likes spacenames of a class loader Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "spacenames of a class loader" Watch "spacenames of a class loader" New topic
Author

spacenames of a class loader

Jose Botella
Ranch Hand

Joined: Jul 03, 2001
Posts: 2120
Question:
Does a class loader stores references for any class loaded by its parents after a request from itself to load a class? In this way the set of classes loaded for a class loader and the returned ones by its parent after a request would comprise the spacename of this class loader.

SCJP2. Please Indent your code using UBB Code
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Java uses packages to control NameSpaces.

From the JVM Specification:

If unique package names are not used, then package name conflicts may arise far from the point of creation of either of the conflicting packages. This may create a situation that is difficult or impossible for the user or programmer to resolve. The class ClassLoader can be used to isolate packages with the same name from each other in those cases where the packages will have constrained interactions, but not in a way that is transparent to a na�ve program.


"JavaRanch, where the deer and the Certified play" - David O'Meara
Junaid Bhatra
Ranch Hand

Joined: Jun 27, 2000
Posts: 213
The answer is no. Classes loaded by different classloaders are in separate namespaces, irrespective of the fact that it may have been delegated by a child to it's parent. If a parent loaded a class, it keeps a reference to it, and the class belongs to it's namespace (also refereed to as the run-time package).

Originally posted by Jose Botella:
Question:
Does a class loader stores references for any class loaded by its parents after a request from itself to load a class? In this way the set of classes loaded for a class loader and the returned ones by its parent after a request would comprise the spacename of this class loader.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: spacenames of a class loader