org.jboss.proxy.compiler
Class ProxyImplementationFactory

java.lang.Object
  extended by org.jboss.proxy.compiler.ProxyImplementationFactory

public class ProxyImplementationFactory
extends Object

Factory to create the bytecode implementation of various methods required by the ProxyCompiler.

Version:
$Revision: 57209 $
Author:
Neale Swinnerton, Jason Dillon

Constructor Summary
ProxyImplementationFactory(String superClassName, String proxyClassName, org.apache.bcel.generic.ClassGen cg)
          Creates a new ProxyImplementationFactory instance.
 
Method Summary
 org.apache.bcel.classfile.Method createConstructor()
          generate an implementation of
 org.apache.bcel.classfile.Method createGetInvocationHandler()
          generate an implementation of
 org.apache.bcel.classfile.Method createGetTargetTypes()
          generate an implementation of
 org.apache.bcel.classfile.Field createInvocationHandlerField()
          generate a field declaration of the form...
 org.apache.bcel.classfile.Method createProxyMethod(String name, int methodNum, org.apache.bcel.generic.Type rType, org.apache.bcel.generic.Type[] pTypes, String[] exceptionNames)
          generate an implementation of...
 org.apache.bcel.classfile.Field createRuntimeField()
          generate a field declaration of the form...
 org.apache.bcel.classfile.Method createToString()
          generate an implementation of
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxyImplementationFactory

public ProxyImplementationFactory(String superClassName,
                                  String proxyClassName,
                                  org.apache.bcel.generic.ClassGen cg)
Creates a new ProxyImplementationFactory instance.

Parameters:
superClassName - a String value
proxyClassName - a String value
cg - a ClassGen value
Method Detail

createGetInvocationHandler

public org.apache.bcel.classfile.Method createGetInvocationHandler()
generate an implementation of

 
    public InvocationHandler getInvocationHandler() {
       return this.invocationHandler;
    }
 

 


createGetTargetTypes

public org.apache.bcel.classfile.Method createGetTargetTypes()
generate an implementation of

 
   public Class[] getTargetTypes {
      return this.invocationHandler.copyTargetTypes();
   }
 

 

Returns:
the method

createToString

public org.apache.bcel.classfile.Method createToString()
generate an implementation of

 
    public String toString() {
       return "ProxyTarget[" + invocationHandler + "]";
    }
 

 

Returns:
the method

createConstructor

public org.apache.bcel.classfile.Method createConstructor()
generate an implementation of

 
   public <proxyClassName> (InvocationHandler h) {
      this.invocationHandler = h;
   }
 

 

Returns:
the method

createProxyMethod

public org.apache.bcel.classfile.Method createProxyMethod(String name,
                                                          int methodNum,
                                                          org.apache.bcel.generic.Type rType,
                                                          org.apache.bcel.generic.Type[] pTypes,
                                                          String[] exceptionNames)
generate an implementation of...

 
   public <return type> <method name>(<p0 type> p0, <p1 type> p1, ...)
      throws e0, e1 ... 
   {
      return runtme.invoke(invocatioHandler, <method index>,
                           new Object[]{boxed p0, boxed p1, ...)};
   }                 
 

 

Returns:
the method

createInvocationHandlerField

public org.apache.bcel.classfile.Field createInvocationHandlerField()
generate a field declaration of the form...

 
   private InvocationHandler invocationHandler;
 

 

Returns:
the method

createRuntimeField

public org.apache.bcel.classfile.Field createRuntimeField()
generate a field declaration of the form...

 
   public static Runtime runtime;
 

 

Returns:
the method


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.