Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

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

List of all members.

Public Member Functions

int compare (File f1, File f2)

Static Public Attributes

final String PROPERTY_APPLICATION_TOPJARS = "acs.system.classpath.appltopjars"
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]
 

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

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:

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"}.

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

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.

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

Map<String, Integer> alma::acs::classloading::JarOrderOptimizer::topJarMap [private]
 

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

boolean alma::acs::classloading::JarOrderOptimizer::verbose = false [private]
 


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 02:51:27 2009 for ACS Java API by doxygen 1.3.8