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

alma::acs::classloading::AcsComponentClassLoader Class Reference

List of all members.

Public Member Functions

 AcsComponentClassLoader (ClassLoader parent, Logger logger, String componentName)
String getSourceObject ()
String getProcessName ()

Static Public Attributes

final String PROPERTY_JARDIRS = "acs.components.classpath.jardirs"
final String PROPERTY_CLASSLOADERVERBOSE = "acs.components.classloader.verbose"

Protected Member Functions

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

Private Member Functions

File[] parseJarDirs (String jarDirPath)

Private Attributes

boolean verbose
final Logger logger
final String componentName

Detailed Description

The component-specific class loader. Attempts to load classes directly, and only delegates to parent class loader after it failed. This bottom-up direction of classloading in the classloader hierarchy follows the J2EE convention, and thus violates the normal J2SE top-down direction.

This class requires the directories that contain component impl jars to be specified in the acs.components.classpath.jardirs property. The startup scripts must set this property. Other jar files (e.g. ACS jars) must be in different directories than those given by this property.

TODO-: this class has a few things in common with alma.acs.classloading.AcsSystemClassLoader, so perhaps during some future refactoring a common base class could be extracted (between URLClassLoader and these).


Constructor & Destructor Documentation

alma::acs::classloading::AcsComponentClassLoader::AcsComponentClassLoader ClassLoader  parent,
Logger  logger,
String  componentName
[inline]
 

Parameters:
parent parent class loader (currently the container class loader)
logger the container logger, for debug output (see PROPERTY_CLASSLOADERVERBOSE). This is also used to derive the processName when logging exceptions.
componentName used for log messages in verbose mode


Member Function Documentation

void alma::acs::classloading::AcsComponentClassLoader::finalize  )  throws Throwable [inline, protected]
 

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

Calls super.findClass(name) and provides some System.out logging if in verbose mode.

See also:
java.lang.ClassLoader#findClass(java.lang.String)

String alma::acs::classloading::AcsComponentClassLoader::getProcessName  )  [inline]
 

Taken from ClientLogManager.stripKnownLoggerNamespacePrefix(). Maybe it should be nice to generalize it and put it somewhere else. Strips the prepended constants NS_CORBA, NS_CONTAINER, NS_COMPONENT etc from the logger namespace. This allows for a short, but possibly not unique display of the logger name.

logger namespace for CORBA classes (ORB, POAs, etc)

logger namespace for container classes during operation

parent of logger namespaces for application components

String alma::acs::classloading::AcsComponentClassLoader::getSourceObject  )  [inline]
 

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

Attempts to load the given class, and only delegates to parent class loader if it failed. This bottom-up direction of classloading in the classloader hierarchy resembles the J2EE convention, and thus violates the normal J2SE top-down direction.

TODO-: check if certain system or ACS classes should be skipped and delegated upward right away. This may improve performance, assuming a bunch of name.startsWith("java.") etc are faster than findLoadedClass and findClass.

See also:
java.lang.ClassLoader#loadClass(java.lang.String, boolean)

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


Member Data Documentation

final String alma::acs::classloading::AcsComponentClassLoader::componentName [private]
 

final Logger alma::acs::classloading::AcsComponentClassLoader::logger [private]
 

final String alma::acs::classloading::AcsComponentClassLoader::PROPERTY_CLASSLOADERVERBOSE = "acs.components.classloader.verbose" [static]
 

Name of the property that flags verbose mode of the component classloader. Verbose mode is a debugging tool, only to be enabled locally by defining this property.

If enabled to be verbose, a component classloader will log the jar files it works with, the classes it loads or fails to load, and also prints a message when it is getting finalized. The latter is useful to monitor component class unloading.

final String alma::acs::classloading::AcsComponentClassLoader::PROPERTY_JARDIRS = "acs.components.classpath.jardirs" [static]
 

Name of the property that defines the directories for component implementation jar files. Example value: ../lib/ACScomponents:/alma/ACS-5.0/ACSSW/lib/ACScomponents:".

boolean alma::acs::classloading::AcsComponentClassLoader::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