test.contrib.classloader
Class Classpath

java.lang.Object
  extended by sun.misc.URLClassPath
      extended by test.contrib.classloader.Classpath

public class Classpath
extends sun.misc.URLClassPath

Classpath resources.
This Class to access the resources whitch is into the class path and cache the defined VM classes.

Since:
Dec 27, 2004
Author:
Mina R Waheeb
See Also:
org.kemetex.kernel.UniversalClassLoader#addPath(Classpath)

Field Summary
protected  java.util.Vector<java.lang.Class> cache
          Cached classes
protected  java.util.ArrayList<Classpath> children
          Children classpaths
 
Constructor Summary
Classpath(java.net.URL[] arg0, java.io.File[] libs)
          Creates a classpath for this URL's
 
Method Summary
protected  boolean addChildren(Classpath path)
           
protected  boolean contains(Classpath path)
           
 java.net.URL find(java.lang.String arg0, boolean arg1)
           
protected  java.lang.Class findClass(java.lang.String name)
          Gets a cached class
protected  Classpath findClasspath(java.lang.String arg0, boolean arg1)
           
protected  java.lang.String findLibrary(java.lang.String libname)
          Returns the absolute path name of a native library
 java.net.URL findResource(java.lang.String arg0, boolean arg1)
           
protected  void linkClass(java.lang.Class clazz)
          Adds a defined VM class to the cache list
 
Methods inherited from class sun.misc.URLClassPath
addURL, checkURL, findResources, getResource, getResource, getResources, getResources, getURLs, pathToURLs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cache

protected final java.util.Vector<java.lang.Class> cache
Cached classes


children

protected final java.util.ArrayList<Classpath> children
Children classpaths

Constructor Detail

Classpath

public Classpath(java.net.URL[] arg0,
                 java.io.File[] libs)
Creates a classpath for this URL's

Parameters:
arg0 - the classpath urls
Method Detail

findLibrary

protected java.lang.String findLibrary(java.lang.String libname)
Returns the absolute path name of a native library

Parameters:
libname - The library name
Returns:
The absolute path of the native library or null if there is no any

linkClass

protected void linkClass(java.lang.Class clazz)
Adds a defined VM class to the cache list

Parameters:
clazz - the class to be cached
See Also:
ClassLoader.defineClass(byte[], int, int)

findClass

protected java.lang.Class findClass(java.lang.String name)
Gets a cached class

Parameters:
name - the class name
Returns:
the class if the class has been cached using add or NULL overwise
See Also:
linkClass(Class)

find

public java.net.URL find(java.lang.String arg0,
                         boolean arg1)

findResource

public java.net.URL findResource(java.lang.String arg0,
                                 boolean arg1)
Overrides:
findResource in class sun.misc.URLClassPath

findClasspath

protected Classpath findClasspath(java.lang.String arg0,
                                  boolean arg1)

contains

protected boolean contains(Classpath path)

addChildren

protected boolean addChildren(Classpath path)