Version: 1.1.1

ca.ucalgary.minnow
Class MinJarMaker

java.lang.Object
  extended by java.lang.ClassLoader
      extended by ca.ucalgary.minnow.MinJarMaker
All Implemented Interfaces:
Runnable

public class MinJarMaker
extends ClassLoader
implements Runnable

This class should be called from the command line using a "clean" JVM (i.e. no extra libraries installed) to act as a recorder of what classes particular to a program are accessed during its running. These classes are then jarred up to provide the minimal non-standard JVM codeset required to execute the program. This class is based on (but is much more comprehensive than) an example at http://www.devx.com/Java/Article/17674/1954?pf=true This application is called "Minnow".

Author:
Paul Gordon gordonp@ucalgary.ca

Field Summary
static String MANIFEST_MAIN_CLASS_PROPERTY
           
static String MANIFEST_PATH
           
static String VERBOSE
           
 
Constructor Summary
MinJarMaker(String jarfile, String program, String[] programArgs, boolean secondaryJars, String webStartIndex)
           
 
Method Summary
 Class findClass(String name)
           
 URL findResource(String name)
           
 Set<String> getLoadedClasses()
           
static void main(String[] args)
           
 void run()
           
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERBOSE

public static String VERBOSE

MANIFEST_PATH

public static final String MANIFEST_PATH
See Also:
Constant Field Values

MANIFEST_MAIN_CLASS_PROPERTY

public static final String MANIFEST_MAIN_CLASS_PROPERTY
See Also:
Constant Field Values
Constructor Detail

MinJarMaker

public MinJarMaker(String jarfile,
                   String program,
                   String[] programArgs,
                   boolean secondaryJars,
                   String webStartIndex)
            throws ClassNotFoundException,
                   InvocationTargetException,
                   NoSuchMethodException,
                   IllegalAccessException,
                   IOException
Throws:
ClassNotFoundException
InvocationTargetException
NoSuchMethodException
IllegalAccessException
IOException
Method Detail

main

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

findResource

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

findClass

public Class findClass(String name)
                throws ClassNotFoundException
Overrides:
findClass in class ClassLoader
Throws:
ClassNotFoundException

getLoadedClasses

public Set<String> getLoadedClasses()

run

public void run()
Specified by:
run in interface Runnable

Version: 1.1.1

Submit a bug or feature
Generated: Sat May 29 04:26:35 EDT 2010