Public Member Functions | Static Public Attributes | Protected Member Functions

alma.acs.classloading.AcsSystemClassLoader Class Reference

Inherits java::net::URLClassLoader.

List of all members.

Public Member Functions

 AcsSystemClassLoader (ClassLoader parent)

Static Public Attributes

static final String PROPERTY_JARDIRS = "acs.system.classpath.jardirs"
static final String PROPERTY_TOPJARSONLY = "acs.system.classpath.topjarsonly"
static 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

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  ) 

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

References alma.acs.makesupport.AcsFileFinder.getAllFiles(), alma.acs.classloading.AcsSystemClassLoader.PROPERTY_CLASSLOADERVERBOSE, alma.acs.classloading.AcsSystemClassLoader.PROPERTY_JARDIRS, and alma.acs.classloading.AcsSystemClassLoader.PROPERTY_TOPJARSONLY.


Member Function Documentation

Class<?> alma.acs.classloading.AcsSystemClassLoader.findClass ( String  name  )  throws ClassNotFoundException [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.

References alma.acs.classloading.JarOrderOptimizer.isClassKnownToBeUnavailable().

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

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

Member Data Documentation

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]

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