org.codehaus.mojo.runtime.execute
Class RuntimeClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by java.security.SecureClassLoader
          extended by org.codehaus.mojo.runtime.execute.RuntimeClassLoader

public class RuntimeClassLoader
extends SecureClassLoader

The RuntimeClassLoader is meant to be used inside of a jar file and takes in a Runtime object (as defined by the runtime mojo, not the System Runtime) and uses the dependencies specified in it to construct references to jar files inside of that jar file.

This classloader can be used with a RuntimeExecutor to generate a complete execution environment.

NOTE: the classes that the RuntimeExecutor are trying in instantiate need to be in their own jars and referenced as dependencies as well, if they are in the same loader as the RuntimeExecutor class then they are loaded by the parent classloader regardless if they are loaded _through_ this classloader...meaning they are unable to resolve the dependencies this classloader services.

Version:
$Id: RuntimeClassLoader.java 2166 2006-07-18 21:32:16Z carlos $
Author:
jesse

Constructor Summary
RuntimeClassLoader(Runtime runtime, ClassLoader parentLoader)
          constructor for the classloader
 
Method Summary
 Class findClass(String className)
           
 Class loadClass(String className)
           
protected  Class loadClass(String className, boolean resolve)
           
 
Methods inherited from class java.security.SecureClassLoader
defineClass, defineClass, getPermissions
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, 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

RuntimeClassLoader

public RuntimeClassLoader(Runtime runtime,
                          ClassLoader parentLoader)
constructor for the classloader

Parameters:
runtime -
parentLoader -
Method Detail

findClass

public Class findClass(String className)
                throws ClassNotFoundException
Overrides:
findClass in class ClassLoader
Throws:
ClassNotFoundException
See Also:
ClassLoader

loadClass

protected Class loadClass(String className,
                          boolean resolve)
                   throws ClassNotFoundException
Overrides:
loadClass in class ClassLoader
Throws:
ClassNotFoundException

loadClass

public Class loadClass(String className)
                throws ClassNotFoundException
Overrides:
loadClass in class ClassLoader
Throws:
ClassNotFoundException


Copyright © 2011 Codehaus. All Rights Reserved.