If this class was instantiated with a GridArchive (not physical file of {@code .nar} file), it first writes the {@code byte[]} to a temporary file,for performance reasons (a physical file can be searched directly against a given file path, where as a stream should be compared against each entry). Once the temporary file is created, it will be used as a physical {@code .nar} file.
{@code GridArchiveClassLoader} supports a parent class loader, which will beused as a fall back option, if the {@code GridArchiveClassLoader} is notcapable of loading a class. Usually, a {@link GridNodeClassLoader} isspecified as the parent class loader, enabling remote node based class loading if a class is not loadable from {@code GridArchive}.
The class loading strategy of {@code GridArchiveClassLoader} is as follows.At loadClass request, this class checks if the class has already been loaded. If so, it will be directly returned. If not, it will then attempt to load the class through its super class, that is {@link java.lang.ClassLoader}. If that also fails, then it will attempt to load the class from the {@code GridArchive}.
When searching for the class in the {@code .nar} file, it first attempts toconvert the given class name to relevant filename and to locate the file directly in the {@code .nar} file. If this fails, it then looks in the{@code .jar} libraries available in the {@code .nar} file, and attempts tolocate the class inside each of the {@code .jar} file.
If all fails, finally it would fall back to the parent class loader, if one was specified. @author Yohan Liyanage @version 1.0 @see GridArchive @see GridNodeClassLoader
|
|
|
|
|
|