org.objectweb.proactive.core.component.asmgen
Class RepresentativeInterfaceClassGenerator

java.lang.Object
  |
  +--org.objectweb.proactive.core.component.asmgen.AbstractInterfaceClassGenerator
        |
        +--org.objectweb.proactive.core.component.asmgen.RepresentativeInterfaceClassGenerator
All Implemented Interfaces:
org.objectweb.asm.Constants

public class RepresentativeInterfaceClassGenerator
extends AbstractInterfaceClassGenerator

Generates Interface implementations for the functional interfaces of the component representative.
This class :
- implements the java interface corresponding to the functional interface of the component.
- implements StubObject, like the standard ProActive stub
- is linked to the ProActive proxy (corresponding to the actual active object)
Method calls are reified as MethodCall objects, that contain :
- a tag signaling component requests
- the name given to the component functional interface.

Author:
Matthieu Morel

Field Summary
protected  boolean isPrimitive
           
protected static org.apache.log4j.Logger logger
           
protected static java.lang.String PROXY_FIELD_NAME
           
protected static java.lang.String PROXY_TYPE
           
protected static java.lang.String STUB_INTERFACE_NAME
           
 
Fields inherited from class org.objectweb.proactive.core.component.asmgen.AbstractInterfaceClassGenerator
cl, classGenerator, className, FUNCTIONAL_INTERFACE_NAME_FIELD_NAME, FUNCTIONAL_INTERFACE_NAME_TYPE, interfacesToImplement, METHOD_ARRAY_TYPE, METHOD_TYPE, METHODCALL_TYPE, methods, OBJECT_ARRAY_TYPE, OBJECT_TYPE, packageName, stubClassFullName, stubClassSimpleName, SUPER_CLASS_NAME
 
Fields inherited from interface org.objectweb.asm.Constants
AALOAD, AASTORE, ACC_ABSTRACT, ACC_BRIDGE, ACC_DEPRECATED, ACC_ENUM, ACC_FINAL, ACC_INTERFACE, ACC_NATIVE, ACC_PRIVATE, ACC_PROTECTED, ACC_PUBLIC, ACC_STATIC, ACC_STRICT, ACC_SUPER, ACC_SYNCHRONIZED, ACC_SYNTHETIC, ACC_TRANSIENT, ACC_VARARGS, ACC_VOLATILE, ACONST_NULL, ALOAD, ANEWARRAY, ARETURN, ARRAYLENGTH, ASTORE, ATHROW, BALOAD, BASTORE, BIPUSH, CALOAD, CASTORE, CHECKCAST, D2F, D2I, D2L, DADD, DALOAD, DASTORE, DCMPG, DCMPL, DCONST_0, DCONST_1, DDIV, DLOAD, DMUL, DNEG, DREM, DRETURN, DSTORE, DSUB, DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2, F2D, F2I, F2L, FADD, FALOAD, FASTORE, FCMPG, FCMPL, FCONST_0, FCONST_1, FCONST_2, FDIV, FLOAD, FMUL, FNEG, FREM, FRETURN, FSTORE, FSUB, GETFIELD, GETSTATIC, GOTO, I2B, I2C, I2D, I2F, I2L, I2S, IADD, IALOAD, IAND, IASTORE, ICONST_0, ICONST_1, ICONST_2, ICONST_3, ICONST_4, ICONST_5, ICONST_M1, IDIV, IF_ACMPEQ, IF_ACMPNE, IF_ICMPEQ, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, IF_ICMPLT, IF_ICMPNE, IFEQ, IFGE, IFGT, IFLE, IFLT, IFNE, IFNONNULL, IFNULL, IINC, ILOAD, IMUL, INEG, INSTANCEOF, INVOKEINTERFACE, INVOKESPECIAL, INVOKESTATIC, INVOKEVIRTUAL, IOR, IREM, IRETURN, ISHL, ISHR, ISTORE, ISUB, IUSHR, IXOR, JSR, L2D, L2F, L2I, LADD, LALOAD, LAND, LASTORE, LCMP, LCONST_0, LCONST_1, LDC, LDIV, LLOAD, LMUL, LNEG, LOOKUPSWITCH, LOR, LREM, LRETURN, LSHL, LSHR, LSTORE, LSUB, LUSHR, LXOR, MONITORENTER, MONITOREXIT, MULTIANEWARRAY, NEW, NEWARRAY, NOP, POP, POP2, PUTFIELD, PUTSTATIC, RET, RETURN, SALOAD, SASTORE, SIPUSH, SWAP, T_BOOLEAN, T_BYTE, T_CHAR, T_DOUBLE, T_FLOAT, T_INT, T_LONG, T_SHORT, TABLESWITCH
 
Constructor Summary
RepresentativeInterfaceClassGenerator()
           
 
Method Summary
protected  void createDefaultMethods()
          implementation of abstract method defined in mother class
protected  void createFields()
          Method createFields.
protected  void createGetAndSetProxyMethods()
           
protected  org.objectweb.asm.CodeVisitor createMethod(int methodIndex, java.lang.reflect.Method m)
          Method createMethod.
protected  void createStaticInitializer()
          Method createStaticInitializer.
protected  void createStaticVariables()
          Method createStaticVariables.
 ProActiveInterface generateInterface(java.lang.String fcInterfaceName, Component owner, InterfaceType interfaceType, boolean isInternal)
           
static byte[] getClassData(java.lang.String classname)
          retreives the bytecode associated to the generated class of the given name
static java.util.Map getGeneratedClassesCache()
          Returns the generatedClassesCache.
static RepresentativeInterfaceClassGenerator instance()
           
protected static int lengthOfType(java.lang.Class cl)
           
 
Methods inherited from class org.objectweb.proactive.core.component.asmgen.AbstractInterfaceClassGenerator
convertJavaModifierToASM, create, createClassGenerator, createConstructor, createMethodGenerator, createReturnCode, createUnwrappingCode, defineClass, getOpcodeOffset, getSize, getStubClassFullName, loadClass, removeNativeAndAbstractModifiers, setInfos
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static org.apache.log4j.Logger logger

PROXY_TYPE

protected static final java.lang.String PROXY_TYPE
See Also:
Constant Field Values

STUB_INTERFACE_NAME

protected static final java.lang.String STUB_INTERFACE_NAME
See Also:
Constant Field Values

PROXY_FIELD_NAME

protected static final java.lang.String PROXY_FIELD_NAME
See Also:
Constant Field Values

isPrimitive

protected boolean isPrimitive
Constructor Detail

RepresentativeInterfaceClassGenerator

public RepresentativeInterfaceClassGenerator()
Method Detail

instance

public static RepresentativeInterfaceClassGenerator instance()

getClassData

public static byte[] getClassData(java.lang.String classname)
retreives the bytecode associated to the generated class of the given name


getGeneratedClassesCache

public static java.util.Map getGeneratedClassesCache()
Returns the generatedClassesCache.

Returns:
a Map acting as a cache for generated classes

generateInterface

public ProActiveInterface generateInterface(java.lang.String fcInterfaceName,
                                            Component owner,
                                            InterfaceType interfaceType,
                                            boolean isInternal)
                                     throws InterfaceGenerationFailedException
InterfaceGenerationFailedException

createMethod

protected org.objectweb.asm.CodeVisitor createMethod(int methodIndex,
                                                     java.lang.reflect.Method m)
Description copied from class: AbstractInterfaceClassGenerator
Method createMethod.

Specified by:
createMethod in class AbstractInterfaceClassGenerator
Parameters:
methodIndex -
m -
Returns:
CodeVisitor

createFields

protected void createFields()
Description copied from class: AbstractInterfaceClassGenerator
Method createFields.

Specified by:
createFields in class AbstractInterfaceClassGenerator

createStaticVariables

protected void createStaticVariables()
Description copied from class: AbstractInterfaceClassGenerator
Method createStaticVariables.

Specified by:
createStaticVariables in class AbstractInterfaceClassGenerator

createStaticInitializer

protected void createStaticInitializer()
                                throws java.lang.ClassNotFoundException
Description copied from class: AbstractInterfaceClassGenerator
Method createStaticInitializer.

Specified by:
createStaticInitializer in class AbstractInterfaceClassGenerator
java.lang.ClassNotFoundException

createGetAndSetProxyMethods

protected void createGetAndSetProxyMethods()

lengthOfType

protected static int lengthOfType(java.lang.Class cl)

createDefaultMethods

protected void createDefaultMethods()
implementation of abstract method defined in mother class

Specified by:
createDefaultMethods in class AbstractInterfaceClassGenerator


Copyright © April 2004 INRIA All Rights Reserved.