Class ProxyCreator

java.lang.Object
  |
  +--ProxyCreator

public class ProxyCreator
extends java.lang.Object

Dynamically creates and uses a proxy for java.awt.event.ActionListener via the classloader mechanism if called with

java de.fub.bytecode.util.JavaWrapper ProxyCreator
The trick is to encode the byte code we need into the class name using the Utility.encode() method. This will result however in big ugly class name, so for many cases it will be more sufficient to put some clever creation code into the class loader.
This is comparable to the mechanism provided via java.lang.reflect.Proxy, but much more flexible.

Version:
$Id: ProxyCreator.java,v 1.6 2001/09/03 09:30:25 dahm Exp $
Author:
M. Dahm
See Also:
JavaWrapper, ClassLoader, Utility

Constructor Summary
ProxyCreator()
           
 
Method Summary
static java.lang.Object createProxy(java.lang.String pack, java.lang.String class_name)
          Load class and create instance
static void main(java.lang.String[] argv)
          Create JavaClass object for a simple proxy for an java.awt.event.ActionListener that just prints the passed arguments, load and use it via the class loader mechanism.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxyCreator

public ProxyCreator()
Method Detail

createProxy

public static java.lang.Object createProxy(java.lang.String pack,
                                           java.lang.String class_name)
Load class and create instance

main

public static void main(java.lang.String[] argv)
                 throws java.lang.Exception
Create JavaClass object for a simple proxy for an java.awt.event.ActionListener that just prints the passed arguments, load and use it via the class loader mechanism.