com.caucho.loader
Class SystemClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by java.security.SecureClassLoader
          extended by java.net.URLClassLoader
              extended by com.caucho.loader.DynamicClassLoader
                  extended by com.caucho.loader.EnvironmentClassLoader
                      extended by com.caucho.loader.SystemClassLoader
All Implemented Interfaces:
EnvironmentBean, Make, DynamicClassLoaderMXBean, Dependency

public class SystemClassLoader
extends EnvironmentClassLoader
implements EnvironmentBean

ClassLoader that initalizes the environment and allows byte code enhancement of classes in the system classpath.

 java -Djava.system.class.loader=com.caucho.loader.SystemClassLoader ...
 
If the system property "system.conf" is defined, it is used as a path to a configuration file that initializes the enviornment. Relative paths are relative to the current directory (See Vfs.getPwd().

Resources defined in system.conf are available to all classes loaded within the jvm.

 java -Dsystem.conf=tests/system.conf -Djava.system.class.loader=com.caucho.loader.SystemClassLoader ...
 


Constructor Summary
SystemClassLoader(java.lang.ClassLoader parent)
          Creates a new SystemClassLoader.
 
Method Summary
 java.lang.String findLibrary(java.lang.String name)
          Returns the full library path for the name.
 java.lang.ClassLoader getClassLoader()
           
protected  java.lang.String getSchema()
           
 void init()
          Initialize the environment.
protected  void initEnvironment()
           
 boolean isJarCacheEnabled()
          Returns true if jar entries should be cached.
 java.lang.Class<?> loadClassImpl(java.lang.String name, boolean resolve)
          Load a class using this class loader
 
Methods inherited from class com.caucho.loader.EnvironmentClassLoader
addListener, addLoaderListener, addScanListener, addScanPackage, addScanRoot, addURL, applyVisibleModules, buildImportClassPath, configureEnhancerEvent, configurePostEnhancerEvent, create, create, create, create, createArtifactManager, destroy, findImportClass, getAdmin, getArtifactManager, getAttribute, getConfigException, getEnvironmentListeners, getHash, getImportResource, getLoaderListeners, getOwner, getResource, getResourceAlias, getResourceAsStream, isActive, putIfAbsent, putResourceAlias, removeAttribute, removeListener, scan, setAttribute, setConfigException, setOwner, start, stop, toString, validate
 
Methods inherited from class com.caucho.loader.DynamicClassLoader
addCodeBasePath, addDependency, addJar, addJarManifestClassPath, addListener, addLoader, addLoader, addManifestClassPath, addNative, addParentPriorityPackage, addParentPriorityPackages, addPathClass, addPermission, addPermission, addPermissions, addPriorityPackage, addRoot, addTransformer, addURL, addURL, appendToClassPathForInstrumentation, buildClassPath, buildResourcePathSpecificFirst, buildSourcePath, clearModified, containsURL, containsURL, definePackage, findClass, findClassImpl, findPath, findResources, getClassEntry, getClassPath, getDependencyCheckInterval, getGlobalDependencyCheckInterval, getHash, getHashCrc, getId, getInstrumentableClassLoader, getListeners, getLoaders, getLocalClassPath, getNewTempClassLoader, getPermissions, getPermissions, getResourcePathSpecificFirst, getResources, getSourcePath, getThrowawayClassLoader, getTransformerList, getURLs, isDestroyed, isDirectoryLoader, isJarCacheEnabledDefault, isModified, isModified, isModified, isModifiedNow, loadClass, loadClass, loadClass, loadClassEntry, logModified, make, removeListener, removeLoader, replace, resetDependencyCheckInterval, sendAddLoaderEvent, setDependencyCheckInterval, setEnableDependencyCheck, setGlobalDependencyCheckInterval, setId, setJarCacheEnabled, setOldLoader, setServletHack, toClassPath
 
Methods inherited from class java.net.URLClassLoader
definePackage, findResource, newInstance, newInstance
 
Methods inherited from class java.security.SecureClassLoader
defineClass, defineClass
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SystemClassLoader

public SystemClassLoader(java.lang.ClassLoader parent)
Creates a new SystemClassLoader.

Method Detail

isJarCacheEnabled

public boolean isJarCacheEnabled()
Description copied from class: DynamicClassLoader
Returns true if jar entries should be cached.

Overrides:
isJarCacheEnabled in class DynamicClassLoader

getClassLoader

public java.lang.ClassLoader getClassLoader()
Specified by:
getClassLoader in interface EnvironmentBean

init

public void init()
Description copied from class: EnvironmentClassLoader
Initialize the environment.

Overrides:
init in class EnvironmentClassLoader

initEnvironment

protected void initEnvironment()
Overrides:
initEnvironment in class EnvironmentClassLoader

loadClassImpl

public java.lang.Class<?> loadClassImpl(java.lang.String name,
                                        boolean resolve)
                                 throws java.lang.ClassNotFoundException
Load a class using this class loader

Overrides:
loadClassImpl in class DynamicClassLoader
Parameters:
name - the classname to load
resolve - if true, resolve the class
Returns:
the loaded classes
Throws:
java.lang.ClassNotFoundException

getSchema

protected java.lang.String getSchema()

findLibrary

public java.lang.String findLibrary(java.lang.String name)
Returns the full library path for the name.

Overrides:
findLibrary in class DynamicClassLoader