Public Member Functions | Static Public Attributes | Package Functions

alma.acs.classloading.JarOrderOptimizer Class Reference

Inherits java::util::Comparator< File >.

List of all members.

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)

Detailed Description

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.

Author:
hsommer created Sep 21, 2004 2:28:51 PM

Constructor & Destructor Documentation

alma.acs.classloading.JarOrderOptimizer.JarOrderOptimizer ( boolean  verbose  )  [package]

Member Function Documentation

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.

Parameters:
allJars jar files to be filtered
Returns:
those whose name matches one from the prio list
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.

Parameters:
name 
Returns:

Referenced by alma.acs.classloading.AcsSystemClassLoader.findClass().

void alma.acs.classloading.JarOrderOptimizer.sortJars ( List< File >  jarlist  )  [package]

Sorts jars using compare(Object, Object).

See also:
Arrays.sort(java.lang.Object[], java.util.Comparator)

Member Data Documentation

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]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties