net.dpml.lang
Class StandardClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by java.security.SecureClassLoader
          extended by java.net.URLClassLoader
              extended by net.dpml.lang.StandardClassLoader
Direct Known Subclasses:
SystemClassLoader

public class StandardClassLoader
extends URLClassLoader

A named classloader.

Version:
1.1.0
Author:
Digital Product Meta Library

Constructor Summary
StandardClassLoader(String name, Category category, URL[] urls, ClassLoader parent)
          Creation of a new classloader.
 
Method Summary
static ClassLoader buildClassLoader(Logger logger, String name, Category category, ClassLoader parent, URI[] uris)
          Internal utility class to build a classloader.
 String getAnnotations()
          Return a string representation of the classloader.
 Category getCategory()
          Return the classloader category
protected  void listClasspath(StringBuffer buffer)
          Internal operation to list the classloader classpath.
protected  void listClasspath(StringBuffer buffer, ClassLoader classloader)
          Internal operation to list a classloader classpath.
 String toString()
          Return a string representing of the classloader.
 String toString(boolean expanded)
          Return a string representing of the classloader.
static String toString(ClassLoader primary, ClassLoader secondary)
          Return a string representing a report fo the common classloader chain following by the primary annd seciondarty classloaders.
static URL[] toURLs(URI[] uris)
          Convert a sequence of URIs to URLs.
 
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, wait, wait, wait
 

Constructor Detail

StandardClassLoader

public StandardClassLoader(String name,
                           Category category,
                           URL[] urls,
                           ClassLoader parent)
Creation of a new classloader.

Parameters:
name - a name identifying the plugin
category - the classloader category identifier
urls - an array of urls to add to the classloader
parent - the parent classloader
Method Detail

buildClassLoader

public static ClassLoader buildClassLoader(Logger logger,
                                           String name,
                                           Category category,
                                           ClassLoader parent,
                                           URI[] uris)
                                    throws IOException
Internal utility class to build a classloader. If the supplied url sequence is zero length the parent classloader is returned directly.

Parameters:
logger - the logging channel
name - the name identifying the classloader
category - the category that this classloader is handling
parent - the parent classloader
uris - the uris to assign as classloader content
Returns:
the classloader
Throws:
IOException - if an I/O error occurs

toURLs

public static URL[] toURLs(URI[] uris)
                    throws IOException
Convert a sequence of URIs to URLs.

Parameters:
uris - the uris to convert
Returns:
the corresponding urls
Throws:
IOException - of a transformation error occurs

getCategory

public Category getCategory()
Return the classloader category

Returns:
the classloader category

getAnnotations

public String getAnnotations()
Return a string representation of the classloader.

Returns:
the string value

toString

public String toString(boolean expanded)
Return a string representing of the classloader.

Parameters:
expanded - if true return an expanded representation of the classloader
Returns:
the string representation

toString

public String toString()
Return a string representing of the classloader.

Overrides:
toString in class Object
Returns:
the string representation

listClasspath

protected void listClasspath(StringBuffer buffer)
Internal operation to list the classloader classpath.

Parameters:
buffer - the buffer to list to

listClasspath

protected void listClasspath(StringBuffer buffer,
                             ClassLoader classloader)
Internal operation to list a classloader classpath.

Parameters:
buffer - the buffer to list to
classloader - the classloader to list

toString

public static String toString(ClassLoader primary,
                              ClassLoader secondary)
Return a string representing a report fo the common classloader chain following by the primary annd seciondarty classloaders.

Parameters:
primary - the primary classloader
secondary - the secondary classloader
Returns:
the report