Keel 2.1RC2

org.keel.core.classloader
Class KeelURLClassLoader

java.lang.Object
  extended byjava.lang.ClassLoader
      extended byjava.security.SecureClassLoader
          extended byjava.net.URLClassLoader
              extended byorg.keel.core.classloader.KeelURLClassLoader
Direct Known Subclasses:
KeelWeavingClassLoader

public class KeelURLClassLoader
extends java.net.URLClassLoader

This is a custom class loader that behaves similarly to URLClassLoader except for the fact that unless the class being loaded is a system class, then the parent classloader is not used to resolve the class. This gurantees that even if the same class (but a different version) exists in the parent loader's classpath, it will not affect the child loader and the correct version of the class from the child loader's path will be loaded.

Version:
$Revision: 1.1 $ $Date: 2003/12/30 01:29:35 $
Author:
Shash Chatterjee Created on Nov 6, 2002

Nested Class Summary
 
Nested classes inherited from class java.lang.ClassLoader
 
Field Summary
 
Fields inherited from class java.net.URLClassLoader
 
Fields inherited from class java.security.SecureClassLoader
 
Fields inherited from class java.lang.ClassLoader
 
Constructor Summary
KeelURLClassLoader(java.net.URL[] urls)
           
KeelURLClassLoader(java.net.URL[] urls, java.lang.ClassLoader loader)
           
 
Method Summary
 java.net.URL getResource(java.lang.String name)
          This method overrides the default behavior, If not a system resource, then the parent class-loader is never consulted.
protected  boolean isSystemResource(java.lang.String name)
          A quick-and-dirty function to determine if the classname is a system class or not.
 java.lang.Class loadClass(java.lang.String name, boolean resolve)
          This method overrides the default behavior, If not a system class, then the parent class-loader is never consulted.
 
Methods inherited from class java.net.URLClassLoader
addURL, definePackage, findClass, findResource, findResources, getPermissions, getURLs, newInstance, newInstance
 
Methods inherited from class java.security.SecureClassLoader
defineClass
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, 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

KeelURLClassLoader

public KeelURLClassLoader(java.net.URL[] urls)
See Also:
URLClassLoader.URLClassLoader(URL[])

KeelURLClassLoader

public KeelURLClassLoader(java.net.URL[] urls,
                          java.lang.ClassLoader loader)
See Also:
URLClassLoader.URLClassLoader(URL[], ClassLoader)
Method Detail

isSystemResource

protected boolean isSystemResource(java.lang.String name)
A quick-and-dirty function to determine if the classname is a system class or not.

Parameters:
name - Name of the class, fully qualified with package name
Returns:
boolean True if the class is a system class, false otherwise

loadClass

public java.lang.Class loadClass(java.lang.String name,
                                 boolean resolve)
                          throws java.lang.ClassNotFoundException
This method overrides the default behavior, If not a system class, then the parent class-loader is never consulted.

Throws:
java.lang.ClassNotFoundException
See Also:
ClassLoader.loadClass(String, boolean)

getResource

public java.net.URL getResource(java.lang.String name)
This method overrides the default behavior, If not a system resource, then the parent class-loader is never consulted.

See Also:
ClassLoader.getResource(String)

Keel 2.1RC2

Please see keelframework.org for information about new Keel releases.