org.objectweb.proactive.core.classloader
Class ProActiveClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by java.security.SecureClassLoader
          extended by java.net.URLClassLoader
              extended by org.objectweb.proactive.core.classloader.ProActiveClassLoader

public class ProActiveClassLoader
extends java.net.URLClassLoader

This class defines a class loader that can fetch classes from other referenced ProActive runtimes. It is able to look for classes in the classpath and, according to the classloader delegation model, and because it is the system classloader, it will load *all* application classes except the system classes. When asked to load a class, this classloader successively tries to : 1. check if the class is a system class, in that case delegates to the parent classloader (primordial class loader) 2. delegate the loading to the super class URLClassLoader, which looks into the classpath. 3. delegate the search of the class data to a ProActiveClassLoaderHelper, then defines the class from the retreived data (bytecode) (if the local ProActiveRuntime has been created) The ProActiveClassLoaderHelper looks for the given class in other runtimes.

Author:
Matthieu Morel

Constructor Summary
ProActiveClassLoader()
           
ProActiveClassLoader(java.lang.ClassLoader parent)
           
 
Method Summary
protected  java.lang.Class<?> findClass(java.lang.String name)
          Looks for the given class in parents, classpath, and if not found delegates the search to a ProActiveClassLoaderHelper
 java.lang.Class<?> loadClass(java.lang.String name)
           
static java.net.URL[] pathToURLs(java.lang.String _classpath)
          Transforms the string classpath to and URL array based classpath.
 
Methods inherited from class java.net.URLClassLoader
addURL, definePackage, findResource, findResources, getPermissions, getURLs, newInstance, newInstance
 
Methods inherited from class java.security.SecureClassLoader
defineClass, defineClass
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, 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

ProActiveClassLoader

public ProActiveClassLoader()

ProActiveClassLoader

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

findClass

protected java.lang.Class<?> findClass(java.lang.String name)
                                throws java.lang.ClassNotFoundException
Looks for the given class in parents, classpath, and if not found delegates the search to a ProActiveClassLoaderHelper

Overrides:
findClass in class java.net.URLClassLoader
Throws:
java.lang.ClassNotFoundException
See Also:
ClassLoader.findClass(java.lang.String)

loadClass

public java.lang.Class<?> loadClass(java.lang.String name)
                             throws java.lang.ClassNotFoundException
Overrides:
loadClass in class java.lang.ClassLoader
Throws:
java.lang.ClassNotFoundException

pathToURLs

public static java.net.URL[] pathToURLs(java.lang.String _classpath)
Transforms the string classpath to and URL array based classpath. The classpath string must be separated with the filesystem path separator.

Parameters:
_classpath - a classpath string
Returns:
URL[] array of wellformed URL's
Throws:
java.net.MalformedURLException - if a malformed URL has occurred in the classpath string.


Copyright 2001-2007 INRIA All Rights Reserved.