net.jini.loaderThe net.jini.loader
package and its subpackages provide APIs related to dynamic class
loading and, in particular, preferred classes.
PreferredClassProvider and the default
RMIClassLoader provider
PreferredClassProvider
has the following difference in behavior from the default
RMIClassLoader provider even when no preferred lists
are used:
For a given class loader, PreferredClassProvider.loadClass
assumes that any class that can be downloaded from the codebase
annotation for classes defined by the loader can always be loaded by
the loader. Therefore, when attempting to load a class from a given
codebase, if the current thread's context class loader or one of its
ancestor loaders has that codebase as its annotation, then
PreferredClassProvider.loadClass will only attempt to
load the class from that loader instead of from one of its own loaders
that downloads from the codebase.
The default RMIClassLoader provider does not make this
assumption; its loadClass method will attempt to download
a class from a codebase even if a class loader with that codebase as
its annotation (such as the current thread's context class loader or
one of its ancestors) could not load the class.
PreferredClassProvider.loadClass makes the assumption
in order to avoid incorrectly returning a preferred class defined by a
different class loader (and thus with a different runtime type) than
that of a locally available class with the same name and codebase
annotation.
In versions of the Norm implementation of the Jini(TM) lease
renewal service prior to v2.0, there are some classes in
norm-dl.jar that are not in norm.jar, and
thus Norm will fail to start with PreferredClassProvider
configured as the RMIClassLoader provider. This problem
can be worked around by using the default RMIClassLoader
provider instead of PreferredClassProvider, or by using
the current version of Norm.