com.croftsoft.core.lang.classloader
Class CacheClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by com.croftsoft.core.lang.classloader.CustomClassLoader
          extended by com.croftsoft.core.lang.classloader.NetClassLoader
              extended by com.croftsoft.core.lang.classloader.CacheClassLoader

public class CacheClassLoader
extends NetClassLoader

Version:
1998-05-30
Author:
David Wallace Croft

Field Summary
protected  File cacheDir
           
protected  Hashtable cacheHashtable
          A list of pathnames of cached files keyed by remote URL name.
 
Fields inherited from class com.croftsoft.core.lang.classloader.NetClassLoader
codebaseURL
 
Constructor Summary
CacheClassLoader(URL codebaseURL, File cacheDir)
          Ex: "http://www.mysticmayhem.com/lib/", "C:\jcache\www.mysticmayhem.com\"
 
Method Summary
 InputStream getResourceAsStream(String name)
          Loads a stream from the URL given by getResource(name).
static void launchMain(String codebaseURLName, String mainClassName, String cacheDirName, String[] args)
          Loads a remote class and launches its main() method.
static void main(String[] args)
          Loads a remote class and launches its main() method.
 
Methods inherited from class com.croftsoft.core.lang.classloader.NetClassLoader
createImage, getResource, invokeMain, launchMain, loadClassData
 
Methods inherited from class com.croftsoft.core.lang.classloader.CustomClassLoader
loadClass, parsePackageName
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, 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
 

Field Detail

cacheHashtable

protected Hashtable cacheHashtable
A list of pathnames of cached files keyed by remote URL name.


cacheDir

protected File cacheDir
Constructor Detail

CacheClassLoader

public CacheClassLoader(URL codebaseURL,
                        File cacheDir)
Ex: "http://www.mysticmayhem.com/lib/", "C:\jcache\www.mysticmayhem.com\"

Method Detail

main

public static void main(String[] args)
                 throws Exception
Loads a remote class and launches its main() method.

Parameters:
Command-line - arguments:
  1. The URL name for the codebase.
  2. The name of the class with the "main(args)" method.
  3. The name of the local persistent resource cache directory.
  4. Subsequent arguments to be passed to the invoked main method.
Example
Throws:
Exception

launchMain

public static void launchMain(String codebaseURLName,
                              String mainClassName,
                              String cacheDirName,
                              String[] args)
                       throws ClassNotFoundException,
                              IllegalAccessException,
                              MalformedURLException
Loads a remote class and launches its main() method.

Throws:
ClassNotFoundException
IllegalAccessException
MalformedURLException

getResourceAsStream

public InputStream getResourceAsStream(String name)
Description copied from class: NetClassLoader
Loads a stream from the URL given by getResource(name). Does not use a cache.

Overrides:
getResourceAsStream in class NetClassLoader

CroftSoft Javadoc

CroftSoft Core Javadoc (2008-09-28 20:58:02)