chrriis.common
Class NetworkURLClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by chrriis.common.NetworkURLClassLoader

public class NetworkURLClassLoader
extends ClassLoader

A class loader that loads classes from a given codebase.

Author:
Christopher Deckers

Constructor Summary
NetworkURLClassLoader(String codebase)
          Construct a network URL classloader, that will load resources from the given codebase.
 
Method Summary
protected  Class<?> findClass(String name)
           
protected  URL findResource(String name)
           
static void main(String[] args)
           
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findResources, 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

NetworkURLClassLoader

public NetworkURLClassLoader(String codebase)
                      throws MalformedURLException
Construct a network URL classloader, that will load resources from the given codebase.

Parameters:
codebase - the codebase to load the resources from.
Throws:
MalformedURLException
Method Detail

findResource

protected URL findResource(String name)
Overrides:
findResource in class ClassLoader

findClass

protected Class<?> findClass(String name)
                      throws ClassNotFoundException
Overrides:
findClass in class ClassLoader
Throws:
ClassNotFoundException

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception