org.apache.axis2.deployment
Class DeploymentClassLoader

java.lang.Object
  extended byjava.lang.ClassLoader
      extended byjava.security.SecureClassLoader
          extended byjava.net.URLClassLoader
              extended byorg.apache.axis2.deployment.DeploymentClassLoader

public class DeploymentClassLoader
extends URLClassLoader


Constructor Summary
DeploymentClassLoader(URL[] urls, ClassLoader parent)
          DeploymentClassLoader is extended from URLClassLoader.
 
Method Summary
protected  Class findClass(String name)
           
 InputStream getResourceAsStream(String name)
           
 void setParentFirst(boolean parentFirst)
           
 
Methods inherited from class java.net.URLClassLoader
addURL, definePackage, 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, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, 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

DeploymentClassLoader

public DeploymentClassLoader(URL[] urls,
                             ClassLoader parent)
DeploymentClassLoader is extended from URLClassLoader. The constructor does not override the super constructor, but does additional steps like find out jar fils inside /lib directory.

Parameters:
urls - URL
parent - parent classloader ClassLoader
Method Detail

findClass

protected Class findClass(String name)
                   throws ClassNotFoundException
Parameters:
name - String Name of the file to be loaded
Returns:
Returns a Class object if it found else returns null or ClassNotFoundException.

The method finds the class in the following way:
1. Calls the super class to check to see whether the class is there. If the class is found then return that , else go to step 2

2. Check wether the class name exist in one of jar files in /lib directory. If it is found, get the byte array and create a Class object from it by calling "defineClass()", else throws ClassNotFoundException.

Throws:
ClassNotFoundException

getResourceAsStream

public InputStream getResourceAsStream(String name)

setParentFirst

public void setParentFirst(boolean parentFirst)