Project JXTA

net.jxta.platform
Class JxtaLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by java.security.SecureClassLoader
          extended by java.net.URLClassLoader
              extended by net.jxta.platform.JxtaLoader

public abstract class JxtaLoader
extends URLClassLoader

A ClassLoader which provides additional JXTA functionality. You can load classes by ModuleSpecID. Classes are defiend with ModuleImplAdvertisements and class loading will determine suitability using the provided compatiblity statements.


Constructor Summary
JxtaLoader(ClassLoader parent)
          Constuct a new loader with the specified parent loader and
JxtaLoader(URL[] urls, ClassLoader parent)
          Constuct a new loader for the specified URLS with the specified parent loader.
 
Method Summary
abstract  Class defineClass(ModuleImplAdvertisement impl)
          Defines a new class from a Module Impl Advertisement.
abstract  Class findClass(ModuleSpecID spec)
          Finds and loads the class with the specified spec ID from the URL search path.
abstract  Class loadClass(ModuleSpecID spec)
          Loads the class with the specified spec ID from the URL search path.
 
Methods inherited from class java.net.URLClassLoader
addURL, definePackage, findClass, 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, 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

JxtaLoader

public JxtaLoader(ClassLoader parent)
Constuct a new loader with the specified parent loader and

Parameters:
parent - the parent class loader for delegation.

JxtaLoader

public JxtaLoader(URL[] urls,
                  ClassLoader parent)
Constuct a new loader for the specified URLS with the specified parent loader.

Parameters:
urls - the URLs from which to load classes and resources.
parent - the parent class loader for delegation.
Method Detail

findClass

public abstract Class findClass(ModuleSpecID spec)
                         throws ClassNotFoundException
Finds and loads the class with the specified spec ID from the URL search path. Any URLs referring to JAR files are loaded and opened as needed until the class is found.

Parameters:
spec - the specid of the class to load.
Returns:
the resulting class.
Throws:
ClassNotFoundException - if the class could not be found.

loadClass

public abstract Class loadClass(ModuleSpecID spec)
                         throws ClassNotFoundException
Loads the class with the specified spec ID from the URL search path.

Parameters:
spec - the specid of the class to load.
Returns:
the resulting class.
Throws:
ClassNotFoundException - if the class could not be found.

defineClass

public abstract Class defineClass(ModuleImplAdvertisement impl)
Defines a new class from a Module Impl Advertisement.

Parameters:
impl - The moduleImplAdvertisement containing the class specification
Returns:
The Class object that was created from the specified class data.

JXTA J2SE