

Public Member Functions | |
| AcsComponentClassLoader (ClassLoader parent, Logger logger, String componentName) | |
| String | getSourceObject () |
| String | getProcessName () |
Static Public Attributes | |
| static final String | PROPERTY_JARDIRS = "acs.components.classpath.jardirs" |
| static 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 |
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).
| alma::acs::classloading::AcsComponentClassLoader::AcsComponentClassLoader | ( | ClassLoader | parent, | |
| Logger | logger, | |||
| String | componentName | |||
| ) | [inline] |
| 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 |
References alma::acs::makesupport::AcsFileFinder::getAllFiles(), parseJarDirs(), PROPERTY_CLASSLOADERVERBOSE, PROPERTY_JARDIRS, alma::acs::makesupport::AcsFileFinder::setVerbose(), and verbose.
| void alma::acs::classloading::AcsComponentClassLoader::finalize | ( | ) | throws Throwable [inline, protected] |
References componentName, logger, and verbose.
| 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.
References componentName, logger, and verbose.
Referenced by loadClass().
| 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
References logger.
| String alma::acs::classloading::AcsComponentClassLoader::getSourceObject | ( | ) | [inline] |
References componentName.
| 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.
References componentName, findClass(), logger, and verbose.
| File [] alma::acs::classloading::AcsComponentClassLoader::parseJarDirs | ( | String | jarDirPath | ) | [inline, private] |
References componentName, logger, and verbose.
Referenced by AcsComponentClassLoader().
final String alma::acs::classloading::AcsComponentClassLoader::componentName [private] |
Referenced by finalize(), findClass(), getSourceObject(), loadClass(), and parseJarDirs().
final Logger alma::acs::classloading::AcsComponentClassLoader::logger [private] |
Referenced by finalize(), findClass(), getProcessName(), loadClass(), and parseJarDirs().
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.
Referenced by AcsComponentClassLoader().
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:".
Referenced by AcsComponentClassLoader().
boolean alma::acs::classloading::AcsComponentClassLoader::verbose [private] |
Referenced by AcsComponentClassLoader(), finalize(), findClass(), loadClass(), and parseJarDirs().
1.6.2