alma::acs::classloading::JarOrderOptimizer Class Reference

Inheritance diagram for alma::acs::classloading::JarOrderOptimizer:
Inheritance graph
[legend]
Collaboration diagram for alma::acs::classloading::JarOrderOptimizer:
Collaboration graph
[legend]

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)

Private Member Functions

String[] parseJarNames (String jarNamePath)

Private Attributes

boolean verbose = false
Map< String, Integer > topJarMap

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  )  [inline, package]

Member Function Documentation

int alma::acs::classloading::JarOrderOptimizer::compare ( File  f1,
File  f2 
) [inline]

References topJarMap.

List<File> alma::acs::classloading::JarOrderOptimizer::getTopJarsOnly ( List< File >  allJars  )  [inline, 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

References topJarMap.

boolean alma::acs::classloading::JarOrderOptimizer::isClassKnownToBeUnavailable ( String  name  )  [inline, 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().

String [] alma::acs::classloading::JarOrderOptimizer::parseJarNames ( String  jarNamePath  )  [inline, private]

Parses a string of concatenated jar file names. For example, the string "ab:cd.jar:ef" should yield {"ab.jar", "cd.jar", "ef.jar"}.

Referenced by JarOrderOptimizer().

void alma::acs::classloading::JarOrderOptimizer::sortJars ( List< File >  jarlist  )  [inline, 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 JarOrderOptimizer().

final String alma::acs::classloading::JarOrderOptimizer::PROPERTY_APPLICATION_TOPJARS = "acs.system.classpath.appltopjars" [static]

Referenced by JarOrderOptimizer().

key = (String) jarname, value = (Integer) position.

Referenced by compare(), getTopJarsOnly(), and JarOrderOptimizer().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2