RMIClassLoader
provider implementations that support preferred classes.See: Description
Class | Description |
---|---|
PreferredClassLoader |
A class loader that supports preferred classes.
|
PreferredClassProvider |
An
RMIClassLoader provider that supports preferred
classes. |
RequireDlPermProvider |
An
RMIClassLoader provider that supports preferred
classes and enforces DownloadPermission . |
RMIClassLoader
provider implementations that support preferred classes.
A preferred class is a class that is to be loaded by a class loader without the loader delegating to its parent class loader first. Resources may also be preferred.
With a class loader that supports preferred classes, the first JAR file or other URL location from which the loader loads classes can contain a preferred list. A preferred list declares names of certain classes and other resources throughout the loader's path of URLs as being preferred or not. When the loader is asked to load a class or resource that is preferred (according to the preferred list) and the class or resource exists in the loader's path of URLs, the loader will not delegate first to its parent class loader as it otherwise would do; instead, it will attempt to load the class or resource from its own path of URLs only.
By controlling class loader delegation, preferred classes can help accomplish the following goals:
There is not a complete or definitive set of rules for when to make a class or resource preferred or not, but the following guidelines are generally advisable:
PreferredClassLoader
is a class loader
implementation that supports preferred classes, and its specification
defines the format of preferred lists.
PreferredClassProvider
is an
RMIClassLoader
provider implementation that uses
PreferredClassLoader
to support preferred classes.
RequireDlPermProvider
is a subclass of
PreferredClassProvider
that enforces DownloadPermission
.