Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.bcel.util
Class JavaWrapper  view JavaWrapper download JavaWrapper.java

java.lang.Object
  extended byorg.apache.bcel.util.JavaWrapper

public class JavaWrapper
extends java.lang.Object

Java interpreter replacement, i.e., wrapper that uses its own ClassLoader to modify/generate classes as they're requested. You can take this as a template for your own applications.
Call this wrapper with

java org.apache.bcel.util.JavaWrapper <real.class.name> [arguments]

To use your own class loader you can set the "bcel.classloader" system property which defaults to "org.apache.bcel.util.ClassLoader", e.g., with

java org.apache.bcel.util.JavaWrapper -Dbcel.classloader=foo.MyLoader <real.class.name> [arguments]

Version:
$Id: JavaWrapper.java 386056 2006-03-15 11:31:56Z tcurdt $

Field Summary
private  java.lang.ClassLoader loader
           
 
Constructor Summary
JavaWrapper()
           
JavaWrapper(java.lang.ClassLoader loader)
           
 
Method Summary
private static java.lang.ClassLoader getClassLoader()
           
static void main(java.lang.String[] argv)
          Default main method used as wrapper, expects the fully qualified class name of the real class as the first argument.
 void runMain(java.lang.String class_name, java.lang.String[] argv)
          Runs the main method of the given class with the arguments passed in argv
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

loader

private java.lang.ClassLoader loader
Constructor Detail

JavaWrapper

public JavaWrapper(java.lang.ClassLoader loader)

JavaWrapper

public JavaWrapper()
Method Detail

getClassLoader

private static java.lang.ClassLoader getClassLoader()

runMain

public void runMain(java.lang.String class_name,
                    java.lang.String[] argv)
             throws java.lang.ClassNotFoundException
Runs the main method of the given class with the arguments passed in argv


main

public static void main(java.lang.String[] argv)
                 throws java.lang.Exception
Default main method used as wrapper, expects the fully qualified class name of the real class as the first argument.