org.openmdx.kernel.application.deploy.spi
Class LightweightClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by java.security.SecureClassLoader
          extended by java.net.URLClassLoader
              extended by org.openmdx.kernel.application.deploy.spi.LightweightClassLoader
All Implemented Interfaces:
MultiLineStringRepresentation

public class LightweightClassLoader
extends URLClassLoader
implements MultiLineStringRepresentation

Lightweight Class Loader


Constructor Summary
LightweightClassLoader(String type, String shortDescription, ClassLoader parent)
          Constructor
LightweightClassLoader(String type, String shortDescription, ClassLoader parent, URL[] urls)
          Constructor
 
Method Summary
 void addURLs(URL[] urls)
          Add a list of URLs to the lightweight class loader's search path, including libraries referred to by manifest class-path entires.
protected static URL getImplementationURL(URL url)
          The Manifest is optional as well as its Implementation-URL attribute.
static Manifest getManifest(File module)
          The Manifest is optional.
protected static Manifest getManifest(String module)
          The Manifest is optional.
static Manifest getManifest(URL module)
          The Manifest is optional.
static URL[] getManifestClassPath(URL url)
          The Manifest is optional as well as its Class-Path attribute.
protected static URL toCanonicalForm(URL url)
          Converts file URL to their canaonical form
 String toString()
           
 
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

LightweightClassLoader

public LightweightClassLoader(String type,
                              String shortDescription,
                              ClassLoader parent)
Constructor

Parameters:
type -
shortDescription -
parent -
urls -

LightweightClassLoader

public LightweightClassLoader(String type,
                              String shortDescription,
                              ClassLoader parent,
                              URL[] urls)
                       throws IOException
Constructor

Parameters:
type -
shortDescription -
parent -
urls -
Throws:
IOException
Method Detail

addURLs

public void addURLs(URL[] urls)
             throws IOException
Add a list of URLs to the lightweight class loader's search path, including libraries referred to by manifest class-path entires.

Parameters:
urls -
Throws:
IOException

toCanonicalForm

protected static URL toCanonicalForm(URL url)
                              throws IOException
Converts file URL to their canaonical form

Parameters:
url -
Returns:
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object

getManifest

public static Manifest getManifest(File module)
                            throws IOException
The Manifest is optional.

Parameters:
module -
Returns:
module's manifest; or null
Throws:
IOException

getManifest

protected static Manifest getManifest(String module)
                               throws IOException
The Manifest is optional.

Parameters:
module -
Returns:
module's manifest; or null
Throws:
IOException

getManifest

public static Manifest getManifest(URL module)
                            throws IOException
The Manifest is optional.

Parameters:
module -
Returns:
module's manifest; or null
Throws:
IOException

getManifestClassPath

public static URL[] getManifestClassPath(URL url)
                                  throws IOException
The Manifest is optional as well as its Class-Path attribute. Return an empty array if either is missing.

Parameters:
url -
Returns:
the manifest class path; never null.
Throws:
IOException

getImplementationURL

protected static URL getImplementationURL(URL url)
                                   throws IOException
The Manifest is optional as well as its Implementation-URL attribute. Return the original URL of either is missing

Parameters:
url -
Returns:
the manifest class path; never null.
Throws:
IOException


This software is published under the BSD license. Copyright © 2003-2007, OMEX AG, Switzerland, All rights reserved. Use is subject to license terms.