Inherits java::util::Comparator< File >.
Public Member Functions | |
int | compare (File f1, File f2) |
Static Public Attributes | |
static final String | PROPERTY_APPLICATION_TOPJARS = "acs.system.classpath.appltopjars" |
static final String[] | orderedAcsJarNames |
Package Functions | |
JarOrderOptimizer (boolean verbose) | |
void | sortJars (List< File > jarlist) |
List< File > | getTopJarsOnly (List< File > allJars) |
boolean | isClassKnownToBeUnavailable (String name) |
Helps sort a list of jar files so that more important jar files appear first. The more important jar files are listed in orderedAcsJarNames and optionally also in the property acs.system.classpath.appltopjars
.
The classloader will then not have to read through unimportant jar files first, which should improve class loading performance on IO-challenged machines.
alma.acs.classloading.JarOrderOptimizer.JarOrderOptimizer | ( | boolean | verbose | ) | [package] |
int alma.acs.classloading.JarOrderOptimizer.compare | ( | File | f1, | |
File | f2 | |||
) |
List<File> alma.acs.classloading.JarOrderOptimizer.getTopJarsOnly | ( | List< File > | allJars | ) | [package] |
To be used for testing only -- allows to filter out all jar files from a list which are not given priority by the compare
method of this class. This allows to write tests that will fail unless all required classes are listed explicitly.
allJars | jar files to be filtered |
boolean alma.acs.classloading.JarOrderOptimizer.isClassKnownToBeUnavailable | ( | String | name | ) | [package] |
Checks if a class comes from any of the subpackages of sun.
or com.sun.
which we strongly assume to not be contained in any jar files that our classloaders have to deal with. These classes should either be loaded by the real system class loader, and when it fails, we assume that they don't exist anywhere so we can skip searching for them.
name |
Referenced by alma.acs.classloading.AcsSystemClassLoader.findClass().
void alma.acs.classloading.JarOrderOptimizer.sortJars | ( | List< File > | jarlist | ) | [package] |
Sorts jars
using compare(Object, Object).
final String [] alma.acs.classloading.JarOrderOptimizer.orderedAcsJarNames [static] |
Hardcoded list of jar files that are sufficient to start an ACS container or other basic ACS software. The class loader will sort these jar files toward the beginning of the classpath (in the given order), and will append jar files from the optional property acs.system.classpath.appltopjars
.
Referenced by alma.acs.classloading.JarOrderOptimizer.JarOrderOptimizer().
final String alma.acs.classloading.JarOrderOptimizer.PROPERTY_APPLICATION_TOPJARS = "acs.system.classpath.appltopjars" [static] |
Referenced by alma.acs.classloading.JarOrderOptimizer.JarOrderOptimizer().