org.sapia.clazzy
Class BaseClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by java.security.SecureClassLoader
          extended by org.sapia.clazzy.BaseClassLoader
Direct Known Subclasses:
CompositeClassLoader, FileSystemClassLoader, JarClassLoader

public class BaseClassLoader
extends java.security.SecureClassLoader

This class overrides the SecureClassLoader class. It allows bypassing the delegation model, by which child classloaders are supposed to resolve classes by first delegating the lookup to their parent classloader.

Inheriting classes should override this class' findClass(String) method to support looking up classes from different sources. Accordingly, inherinting classes should also override this class' resource-related methods, such as findResource().

Author:
Yanick Duchesne
Copyright:
Copyright © 2002-2004 Sapia Open Source Software . All Rights Reserved.
License:
Read the license.txt file of the jar or visit the license page at the Sapia OSS web site

Constructor Summary
BaseClassLoader()
           
BaseClassLoader(java.lang.ClassLoader parent)
           
 
Method Summary
 java.lang.Class loadClass(java.lang.String name, boolean resolve)
           
 void setParentFirst(boolean parentFirst)
           
 
Methods inherited from class java.security.SecureClassLoader
defineClass, defineClass, getPermissions
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseClassLoader

public BaseClassLoader()

BaseClassLoader

public BaseClassLoader(java.lang.ClassLoader parent)
Method Detail

setParentFirst

public void setParentFirst(boolean parentFirst)
Parameters:
parentFirst - if true, indicates that this instance should ask its parent for the specified classes rather then looking them up itself (this is the delegation model suggested by Java's API). Defaults to true.

loadClass

public java.lang.Class loadClass(java.lang.String name,
                                 boolean resolve)
                          throws java.lang.ClassNotFoundException
Overrides:
loadClass in class java.lang.ClassLoader
Throws:
java.lang.ClassNotFoundException
See Also:
ClassLoader.loadClass(java.lang.String, boolean)


Copyright © 2011 Sapia OSS. All Rights Reserved.