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

alma::acs::classloading::AcsSystemClassLoader Class Reference

Collaboration diagram for alma::acs::classloading::AcsSystemClassLoader:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 AcsSystemClassLoader (ClassLoader parent)

Static Public Attributes

final String PROPERTY_JARDIRS = "acs.system.classpath.jardirs"
final String PROPERTY_TOPJARSONLY = "acs.system.classpath.topjarsonly"
final String PROPERTY_CLASSLOADERVERBOSE = "acs.system.classloader.verbose"

Protected Member Functions

synchronized Class<?> loadClass (String name, boolean resolve) throws ClassNotFoundException
Class<?> findClass (String name) throws ClassNotFoundException

Private Member Functions

File[] parseJarDirs (String jarDirPath)
void prependCLASSPATHJars (List< File > jarFileList)
void appendToClassPathForInstrumentation (String jarPathName)

Private Attributes

boolean verbose
final JarOrderOptimizer optimizer
final URLClassLoader appClassLoader

Detailed Description

Custom class loader which correctly handles multiple occurences of identical jar files in "overlayed" directories. These directories would typically be ../lib, INTROOT/lib, ACSROOT/lib and ORB dirs.

The main purpose is to cut down the very long classpath produced otherwise by the ACS start scripts. Only the jar file that contains this class loader must be supplied to the JVM using the "-classpath" option. The JVM must be started with property definitions similar to:

Notes on the classloader hierarchies:

Author:
hsommer created Sep 13, 2004 6:31:32 PM


Constructor & Destructor Documentation

alma::acs::classloading::AcsSystemClassLoader::AcsSystemClassLoader ClassLoader  parent  )  [inline]
 

Constructor will be called by the JVM. The standard system class loader (instance of sun.misc.Launcher$AppClassLoader is expected to be the parent parameter, although no such assumption is made in the code.

In the ctor, the directories given in acs.system.classpath.jardirs are searched for JAR files, which are fed as URLs into the classpath maintained by the URLClassLoader base class.

See also:
AcsJarFileFinder


Member Function Documentation

void alma::acs::classloading::AcsSystemClassLoader::appendToClassPathForInstrumentation String  jarPathName  )  [inline, private]
 

This method, even though private, allows jconsole and possibly similar profilers and other tools to add their required jar files, see java.lang.instrument.Instrumentation#appendToSystemClassLoaderSearch(java.util.jar.JarFile)}.

For example, jconsole would currently call this method with argument /usr/java/jdk1.6.0_02/jre/lib/management-agent.jar .

Since:
ACS 7.0

Class<?> alma::acs::classloading::AcsSystemClassLoader::findClass String  name  )  throws ClassNotFoundException [inline, protected]
 

Delegates to base class implementation.

Discards requests to load classes from certain sub-packages of sun. or com.sun. by throwing a ClassNotFoundException. The JDK libs try to search (e.g. during ACS container startup) for some optional system classes such as sun.text.resources.DateFormatZoneData_en_US or sun.util.logging.resources.logging_en. We know that ALMA jar files do not contain any classes in those packages, and can thus speed up the applications, in cases where those classes have already been searched unsuccessfully by any parent class loaders, which as the last step desparately would ask this class loader, which would cause a search through all jar files. sun.awt.resources. com.sun.swing.internal.plaf.

synchronized Class<?> alma::acs::classloading::AcsSystemClassLoader::loadClass String  name,
boolean  resolve
throws ClassNotFoundException [inline, protected]
 

File [] alma::acs::classloading::AcsSystemClassLoader::parseJarDirs String  jarDirPath  )  [inline, private]
 

void alma::acs::classloading::AcsSystemClassLoader::prependCLASSPATHJars List< File >  jarFileList  )  [inline, private]
 

Extracts the CLASSPATH jar files (or directories) from the parent class loader and adds them at the beginning of the given list.

It is assumed that thanks to the java.system.class.loader property, this AcsSystemClassLoader is a direct child of the application system class loader which normally would handle the CLASSPATH.


Member Data Documentation

final URLClassLoader alma::acs::classloading::AcsSystemClassLoader::appClassLoader [private]
 

final JarOrderOptimizer alma::acs::classloading::AcsSystemClassLoader::optimizer [private]
 

final String alma::acs::classloading::AcsSystemClassLoader::PROPERTY_CLASSLOADERVERBOSE = "acs.system.classloader.verbose" [static]
 

final String alma::acs::classloading::AcsSystemClassLoader::PROPERTY_JARDIRS = "acs.system.classpath.jardirs" [static]
 

final String alma::acs::classloading::AcsSystemClassLoader::PROPERTY_TOPJARSONLY = "acs.system.classpath.topjarsonly" [static]
 

boolean alma::acs::classloading::AcsSystemClassLoader::verbose [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