Smartproxy
0.2

net.ggtools.smartproxy
Interface ProxyClassGenerator

All Known Implementing Classes:
SimpleProxyClassGenerator

public interface ProxyClassGenerator

Interface for proxy class generators. A proxy class generator is responsible for providing high level method to build a proxy class using BCEL. A typical proxy building using a proxy class generator is:

    generator.init();
 
    for each constructor:
       generator.addConstructor(constructor);
 
    for each method to proxify:
       generator.addMethod(method);
 
    bcelResult = generator.getJavaClass();
 

Author:
Christophe Labouisse

Method Summary
 void addConstructor(Constructor constructor)
          Add a new constructor to the proxy class.
 void addProxyMethod(Method method)
          Add a new proxified method.
 JavaClass getJavaClass()
          Get the BCEL class for the generated class.
 void init()
          Initialize the object for a new class generation.
 

Method Detail

init

public void init()
Initialize the object for a new class generation. Any class generated so far will be lost. This method must be called before addConstructor of addProxyMethod.


addConstructor

public void addConstructor(Constructor constructor)
                    throws IllegalStateException
Add a new constructor to the proxy class.

Parameters:
constructor -
Throws:
IllegalStateException - init wasn't called previously.

addProxyMethod

public void addProxyMethod(Method method)
                    throws IllegalStateException
Add a new proxified method.

Parameters:
method -
Throws:
IllegalStateException - init wasn't called previously.

getJavaClass

public JavaClass getJavaClass()
                       throws IllegalStateException
Get the BCEL class for the generated class.

Returns:
the class generated.
Throws:
IllegalStateException - init wasn't called previously.

Smartproxy
0.2